Support eml attachments in email.
Change-Id: I76274540d00a292d5a8f777d75d8e9f7b2ef3a51
This commit is contained in:
parent
a54ee609cd
commit
478417a794
|
@ -354,6 +354,14 @@
|
||||||
<grant-uri-permission android:pathPattern=".*" />
|
<grant-uri-permission android:pathPattern=".*" />
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
|
<provider
|
||||||
|
android:authorities="@string/eml_attachment_provider"
|
||||||
|
android:multiprocess="false"
|
||||||
|
android:exported="false"
|
||||||
|
android:name="com.android.mail.providers.EmlAttachmentProvider" >
|
||||||
|
<grant-uri-permission android:pathPattern=".*" />
|
||||||
|
</provider>
|
||||||
|
|
||||||
<!-- The android:name is the name of the Provider class which is stored in
|
<!-- The android:name is the name of the Provider class which is stored in
|
||||||
UnifiedEmail, and has package name com.android.mail.providers and the class is
|
UnifiedEmail, and has package name com.android.mail.providers and the class is
|
||||||
called SuggestionsProvider. The authority name is specified in the MailAppProvider
|
called SuggestionsProvider. The authority name is specified in the MailAppProvider
|
||||||
|
@ -698,6 +706,7 @@
|
||||||
</service>
|
</service>
|
||||||
<service android:name="com.android.mail.MailLogService">
|
<service android:name="com.android.mail.MailLogService">
|
||||||
</service>
|
</service>
|
||||||
|
<service android:name="com.android.mail.browse.EmlTempFileDeletionService" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
<!-- Legacy permissions, etc. can go here -->
|
<!-- Legacy permissions, etc. can go here -->
|
||||||
|
|
|
@ -1283,4 +1283,7 @@ as <xliff:g id="filename">%s</xliff:g>.</string>
|
||||||
<string name="protocol_pop3" translatable="false">pop3</string>
|
<string name="protocol_pop3" translatable="false">pop3</string>
|
||||||
<string name="protocol_eas" translatable="false">eas</string>
|
<string name="protocol_eas" translatable="false">eas</string>
|
||||||
<string name="application_mime_type" translatable="false">application/email-ls</string>
|
<string name="application_mime_type" translatable="false">application/email-ls</string>
|
||||||
|
|
||||||
|
<!-- Content Provider Authority for Eml Attachments -->
|
||||||
|
<string name="eml_attachment_provider" translatable="false">com.android.email.provider.eml.attachment</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2998,7 +2998,10 @@ public class EmailProvider extends ContentProvider {
|
||||||
*/
|
*/
|
||||||
private static String genQueryAttachments(String[] uiProjection,
|
private static String genQueryAttachments(String[] uiProjection,
|
||||||
List<String> contentTypeQueryParameters) {
|
List<String> 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 +
|
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) {
|
private String genQueryAttachment(String[] uiProjection, String idString) {
|
||||||
Long id = Long.parseLong(idString);
|
Long id = Long.parseLong(idString);
|
||||||
Attachment att = Attachment.restoreAttachmentWithId(getContext(), id);
|
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,
|
values.put(AttachmentColumns.CONTENT_URI,
|
||||||
AttachmentUtilities.getAttachmentUri(att.mAccountKey, id).toString());
|
AttachmentUtilities.getAttachmentUri(att.mAccountKey, id).toString());
|
||||||
|
values.put(UIProvider.AttachmentColumns.SUPPORTS_DOWNLOAD_AGAIN, 1);
|
||||||
StringBuilder sb = genSelect(getAttachmentMap(), uiProjection, values);
|
StringBuilder sb = genSelect(getAttachmentMap(), uiProjection, values);
|
||||||
sb.append(" FROM " + Attachment.TABLE_NAME + " WHERE " + AttachmentColumns.ID + " =? ");
|
sb.append(" FROM " + Attachment.TABLE_NAME + " WHERE " + AttachmentColumns.ID + " =? ");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
|
Loading…
Reference in New Issue