diff options
author | Tom Taylor <tomtaylor@google.com> | 2010-07-21 10:49:48 -0700 |
---|---|---|
committer | Tom Taylor <tomtaylor@google.com> | 2010-07-21 10:49:48 -0700 |
commit | dbac180d8342a7db2bb9994f937869eecb6b50ff (patch) | |
tree | 76d31c2ef9d9adcae2af8244ac378efbefc7e46a /core | |
parent | 2f0dc6d9f50ceece294e9db393583e655d3bf781 (diff) | |
download | frameworks_base-dbac180d8342a7db2bb9994f937869eecb6b50ff.zip frameworks_base-dbac180d8342a7db2bb9994f937869eecb6b50ff.tar.gz frameworks_base-dbac180d8342a7db2bb9994f937869eecb6b50ff.tar.bz2 |
Fix a merge problem with html mms
Html mms message support was added back in Jan '10. At that time, we
had moved the mms code out of the framework into the mms app. We decided
to back out that change and leave the mms code in its original place.
As a result, the changes to support html messages were lost. This
handmerged CL restores those changes. I'll cherry-pick this into master
as well. Bug 2858888
Change-Id: Icf8835edc8ac396698c167be5433a6fe1cfe6103
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/google/android/mms/ContentType.java | 1 | ||||
-rw-r--r-- | core/java/com/google/android/mms/pdu/PduParser.java | 4 | ||||
-rw-r--r-- | core/java/com/google/android/mms/pdu/PduPersister.java | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/core/java/com/google/android/mms/ContentType.java b/core/java/com/google/android/mms/ContentType.java index 94bc9fd..b066fad 100644 --- a/core/java/com/google/android/mms/ContentType.java +++ b/core/java/com/google/android/mms/ContentType.java @@ -26,6 +26,7 @@ public class ContentType { public static final String MMS_GENERIC = "application/vnd.wap.mms-generic"; public static final String MULTIPART_MIXED = "application/vnd.wap.multipart.mixed"; public static final String MULTIPART_RELATED = "application/vnd.wap.multipart.related"; + public static final String MULTIPART_ALTERNATIVE = "application/vnd.wap.multipart.alternative"; public static final String TEXT_PLAIN = "text/plain"; public static final String TEXT_HTML = "text/html"; diff --git a/core/java/com/google/android/mms/pdu/PduParser.java b/core/java/com/google/android/mms/pdu/PduParser.java index d465c5a..131ac51 100644 --- a/core/java/com/google/android/mms/pdu/PduParser.java +++ b/core/java/com/google/android/mms/pdu/PduParser.java @@ -157,9 +157,11 @@ public class PduParser { } String ctTypeStr = new String(contentType); if (ctTypeStr.equals(ContentType.MULTIPART_MIXED) - || ctTypeStr.equals(ContentType.MULTIPART_RELATED)) { + || ctTypeStr.equals(ContentType.MULTIPART_RELATED) + || ctTypeStr.equals(ContentType.MULTIPART_ALTERNATIVE)) { // The MMS content type must be "application/vnd.wap.multipart.mixed" // or "application/vnd.wap.multipart.related" + // or "application/vnd.wap.multipart.alternative" return retrieveConf; } return null; diff --git a/core/java/com/google/android/mms/pdu/PduPersister.java b/core/java/com/google/android/mms/pdu/PduPersister.java index d4ac24a..9fdd204 100644 --- a/core/java/com/google/android/mms/pdu/PduPersister.java +++ b/core/java/com/google/android/mms/pdu/PduPersister.java @@ -422,7 +422,8 @@ public class PduPersister { // Store simple string values directly in the database instead of an // external file. This makes the text searchable and retrieval slightly // faster. - if ("text/plain".equals(type) || "application/smil".equals(type)) { + if (ContentType.TEXT_PLAIN.equals(type) || ContentType.APP_SMIL.equals(type) + || ContentType.TEXT_HTML.equals(type)) { String text = c.getString(PART_COLUMN_TEXT); byte [] blob = new EncodedStringValue(text != null ? text : "") .getTextString(); @@ -736,7 +737,9 @@ public class PduPersister { try { byte[] data = part.getData(); - if ("text/plain".equals(contentType) || "application/smil".equals(contentType)) { + if (ContentType.TEXT_PLAIN.equals(contentType) + || ContentType.APP_SMIL.equals(contentType) + || ContentType.TEXT_HTML.equals(contentType)) { ContentValues cv = new ContentValues(); cv.put(Telephony.Mms.Part.TEXT, new EncodedStringValue(data).getString()); if (mContentResolver.update(uri, cv, null, null) != 1) { |