diff options
author | Jin Cao <jinyan@google.com> | 2014-10-03 19:27:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-03 19:27:22 +0000 |
commit | 0e14dc58a0f207b024c86802b248712c6b24893a (patch) | |
tree | 6c39da47b0f141fa302a41b29bce5601f895c111 /src | |
parent | fad4f609e739fc0d4839347ee37a53cc2aa761ec (diff) | |
parent | efd62cb7d4b42d0f88160600fc8c572054d1c4d5 (diff) | |
download | android_packages_apps_UnifiedEmail-0e14dc58a0f207b024c86802b248712c6b24893a.tar.gz android_packages_apps_UnifiedEmail-0e14dc58a0f207b024c86802b248712c6b24893a.tar.bz2 android_packages_apps_UnifiedEmail-0e14dc58a0f207b024c86802b248712c6b24893a.zip |
Merge "Log when html conversion fails" into ub-gmail-ur14-dev
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; |