Usse attachmentsJson.
Change-Id: If8af8c1d10359a8024bcb63ad1ba11f008d8f22f
This commit is contained in:
parent
e7cab0a8a4
commit
0729415a3e
@ -3022,14 +3022,14 @@ outer:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get attachments from the ContentValues
|
// Get attachments from the ContentValues
|
||||||
ArrayList<com.android.mail.providers.Attachment> uiAtts =
|
List<com.android.mail.providers.Attachment> uiAtts =
|
||||||
com.android.mail.providers.Attachment.getAttachmentsFromJoinedAttachmentInfo(
|
com.android.mail.providers.Attachment.fromJSONArray(
|
||||||
values.getAsString(UIProvider.MessageColumns.JOINED_ATTACHMENT_INFOS));
|
values.getAsString(UIProvider.MessageColumns.JOINED_ATTACHMENT_INFOS));
|
||||||
ArrayList<Attachment> atts = new ArrayList<Attachment>();
|
ArrayList<Attachment> atts = new ArrayList<Attachment>();
|
||||||
boolean hasUnloadedAttachments = false;
|
boolean hasUnloadedAttachments = false;
|
||||||
for (com.android.mail.providers.Attachment uiAtt: uiAtts) {
|
for (com.android.mail.providers.Attachment uiAtt: uiAtts) {
|
||||||
Uri attUri = uiAtt.contentUri;
|
Uri attUri = uiAtt.uri;
|
||||||
if (attUri.getAuthority().equals(EmailContent.AUTHORITY)) {
|
if (attUri != null && attUri.getAuthority().equals(EmailContent.AUTHORITY)) {
|
||||||
// If it's one of ours, retrieve the attachment and add it to the list
|
// If it's one of ours, retrieve the attachment and add it to the list
|
||||||
long attId = Long.parseLong(attUri.getLastPathSegment());
|
long attId = Long.parseLong(attUri.getLastPathSegment());
|
||||||
Attachment att = Attachment.restoreAttachmentWithId(context, attId);
|
Attachment att = Attachment.restoreAttachmentWithId(context, attId);
|
||||||
|
@ -228,13 +228,15 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm
|
|||||||
new String[] {BodyColumns.SOURCE_MESSAGE_KEY},
|
new String[] {BodyColumns.SOURCE_MESSAGE_KEY},
|
||||||
BodyColumns.MESSAGE_KEY + "=?",
|
BodyColumns.MESSAGE_KEY + "=?",
|
||||||
new String[] {Long.toString(messageId)}, null, 0, -1L);
|
new String[] {Long.toString(messageId)}, null, 0, -1L);
|
||||||
if (sourceId != -1L) {
|
if (sourceId != -1 ) {
|
||||||
EmailContent.Message sourceMsg =
|
EmailContent.Message sourceMsg =
|
||||||
EmailContent.Message.restoreMessageWithId(mContext, sourceId);
|
EmailContent.Message.restoreMessageWithId(mContext, sourceId);
|
||||||
|
if (sourceMsg != null) {
|
||||||
mailbox = Mailbox.restoreMailboxWithId(mContext, sourceMsg.mMailboxKey);
|
mailbox = Mailbox.restoreMailboxWithId(mContext, sourceMsg.mMailboxKey);
|
||||||
message.mServerId = sourceMsg.mServerId;
|
message.mServerId = sourceMsg.mServerId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (account == null || mailbox == null) {
|
if (account == null || mailbox == null) {
|
||||||
// If the account/mailbox are gone, just report success; the UI handles this
|
// If the account/mailbox are gone, just report success; the UI handles this
|
||||||
|
Loading…
Reference in New Issue
Block a user