am bf922ddc: am a6cd7cbd: Merge "Fix IMAP send by ensuring system mailboxes exist." into jb-ub-mail-ur9

* commit 'bf922ddcf2ec5ddbb0c59b878475a80646beb87b':
  Fix IMAP send by ensuring system mailboxes exist.
This commit is contained in:
Yu Ping Hu 2013-03-14 17:19:53 +00:00 committed by Android Git Automerger
commit d48e11e5d6

View File

@ -3871,10 +3871,14 @@ outer:
}
if (msg == null) return null;
final long mailboxId = Mailbox.findMailboxOfType(context, accountId, Mailbox.TYPE_OUTBOX);
if (mailboxId == Mailbox.NO_MAILBOX) return null;
final Mailbox mailbox = Mailbox.restoreMailboxWithId(context, mailboxId);
final Mailbox mailbox = getMailboxByAccountIdAndType(uri.getPathSegments().get(1),
Mailbox.TYPE_OUTBOX);
if (mailbox == null) return null;
// Make sure the sent mailbox exists, since it will be necessary soon.
// TODO(yph): move system mailbox creation to somewhere sane.
final Mailbox sentMailbox = getMailboxByAccountIdAndType(uri.getPathSegments().get(1),
Mailbox.TYPE_SENT);
if (sentMailbox == null) return null;
final ContentValues values = translateMessage(extras);
// Get the Bundle of open fds from the extra
final Bundle attachmentFds =