From e29288629da1771f44623ada19963ca7c71199a7 Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Fri, 30 Sep 2011 15:18:56 +0800 Subject: [PATCH] Convert content type "image/jpg" to "image/jpeg". "image/jpg" is not a valid mimetype while "image/jpeg" is. So change it to "image/jpeg" to increase the compatibillity with other Apps in android. (e.g., Gallery) bug: 5342561 Change-Id: Ia37433e35482492b7226c87a670bef3399ac4bb6 --- core/java/com/google/android/mms/pdu/PduPersister.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/java/com/google/android/mms/pdu/PduPersister.java b/core/java/com/google/android/mms/pdu/PduPersister.java index 4d2d535444f71..c4be51328997c 100644 --- a/core/java/com/google/android/mms/pdu/PduPersister.java +++ b/core/java/com/google/android/mms/pdu/PduPersister.java @@ -667,6 +667,13 @@ public class PduPersister { String contentType = null; if (part.getContentType() != null) { contentType = toIsoString(part.getContentType()); + + // There is no "image/jpg" in Android (and it's an invalid mimetype). + // Change it to "image/jpeg" + if (ContentType.IMAGE_JPG.equals(contentType)) { + contentType = ContentType.IMAGE_JPEG; + } + values.put(Part.CONTENT_TYPE, contentType); // To ensure the SMIL part is always the first part. if (ContentType.APP_SMIL.equals(contentType)) {