From 478417a79440904b8a9c45fd3e4ec84db339a755 Mon Sep 17 00:00:00 2001 From: Andrew Sapperstein Date: Fri, 21 Jun 2013 11:30:49 -0700 Subject: [PATCH] Support eml attachments in email. Change-Id: I76274540d00a292d5a8f777d75d8e9f7b2ef3a51 --- AndroidManifest.xml | 9 +++++++++ res/values/strings.xml | 3 +++ src/com/android/email/provider/EmailProvider.java | 9 +++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 639d90acb..badbfdcbb 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -354,6 +354,14 @@ + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 2053c81d7..6864ed33b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1283,4 +1283,7 @@ as %s. pop3 eas application/email-ls + + + com.android.email.provider.eml.attachment diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 49e86874d..2eb8b08dd 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -2998,7 +2998,10 @@ public class EmailProvider extends ContentProvider { */ private static String genQueryAttachments(String[] uiProjection, List contentTypeQueryParameters) { - StringBuilder sb = genSelect(getAttachmentMap(), uiProjection); + // MAKE SURE THESE VALUES STAY IN SYNC WITH GEN QUERY ATTACHMENT + ContentValues values = new ContentValues(1); + values.put(UIProvider.AttachmentColumns.SUPPORTS_DOWNLOAD_AGAIN, 1); + StringBuilder sb = genSelect(getAttachmentMap(), uiProjection, values); sb.append(" FROM " + Attachment.TABLE_NAME + " WHERE " + AttachmentColumns.MESSAGE_KEY + " =? "); @@ -3032,9 +3035,11 @@ public class EmailProvider extends ContentProvider { private String genQueryAttachment(String[] uiProjection, String idString) { Long id = Long.parseLong(idString); Attachment att = Attachment.restoreAttachmentWithId(getContext(), id); - ContentValues values = new ContentValues(); + // MAKE SURE THESE VALUES STAY IN SYNC WITH GEN QUERY ATTACHMENTS + ContentValues values = new ContentValues(2); values.put(AttachmentColumns.CONTENT_URI, AttachmentUtilities.getAttachmentUri(att.mAccountKey, id).toString()); + values.put(UIProvider.AttachmentColumns.SUPPORTS_DOWNLOAD_AGAIN, 1); StringBuilder sb = genSelect(getAttachmentMap(), uiProjection, values); sb.append(" FROM " + Attachment.TABLE_NAME + " WHERE " + AttachmentColumns.ID + " =? "); return sb.toString();