diff options
author | Jin Cao <jinyan@google.com> | 2014-10-02 17:50:07 -0700 |
---|---|---|
committer | Jin Cao <jinyan@google.com> | 2014-10-02 17:50:07 -0700 |
commit | efd62cb7d4b42d0f88160600fc8c572054d1c4d5 (patch) | |
tree | cdedeec94a7b3a0f0dd60ac910b5641e813b6a17 /src | |
parent | a29cdae677088bbe45d4e557e4cf3756437a5b86 (diff) | |
download | android_packages_apps_UnifiedEmail-efd62cb7d4b42d0f88160600fc8c572054d1c4d5.tar.gz android_packages_apps_UnifiedEmail-efd62cb7d4b42d0f88160600fc8c572054d1c4d5.tar.bz2 android_packages_apps_UnifiedEmail-efd62cb7d4b42d0f88160600fc8c572054d1c4d5.zip |
Log when html conversion fails
b/16489004
Change-Id: Iafebebd6dfab8a2e76a4405bfd87a3c7b0dc65f8
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/mail/compose/ComposeActivity.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java index ebb998eee..d48c18928 100644 --- a/src/com/android/mail/compose/ComposeActivity.java +++ b/src/com/android/mail/compose/ComposeActivity.java @@ -1133,8 +1133,11 @@ public class ComposeActivity extends ActionBarActivity message.bodyHtml = spannedBodyToHtml(body, true); message.bodyText = body.toString(); // Fallback to use the text version if html conversion fails for whatever the reason. - if (!TextUtils.isEmpty(message.bodyText) && - TextUtils.isEmpty(Utils.convertHtmlToPlainText(message.bodyHtml))) { + final String htmlInPlainText = Utils.convertHtmlToPlainText(message.bodyHtml); + if (!TextUtils.isEmpty(message.bodyText) && TextUtils.isEmpty(htmlInPlainText)) { + LogUtils.w(LOG_TAG, "FAILED HTML CONVERSION: from %d to %d", message.bodyText.length(), + htmlInPlainText.length()); + Analytics.getInstance().sendEvent("errors", "failed_html_conversion", null, 0); message.bodyHtml = "<p>" + message.bodyText + "</p>"; } message.embedsExternalResources = false; |