From 863e6c40202fe804d92a263809da74ec1e904e66 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 19 Nov 2009 16:56:42 -0800 Subject: [PATCH] Handle "send outgoing messages" properly for combined Outbox * The "send outgoing messages" button doesn't work in the combined inbox (the case wasn't handled) * Add code to loop through accounts, calling the Controller for each in this case * Fixes (partially or completely) #2274389 Change-Id: I94e984247d43f93a4d6546b8c10f6ce149b091be --- .../android/email/activity/MessageList.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/activity/MessageList.java b/src/com/android/email/activity/MessageList.java index 670504333..b4334e572 100644 --- a/src/com/android/email/activity/MessageList.java +++ b/src/com/android/email/activity/MessageList.java @@ -604,8 +604,22 @@ public class MessageList extends ListActivity implements OnItemClickListener, On } private void onSendPendingMessages() { - long accountId = lookupAccountIdFromMailboxId(mMailboxId); - mController.sendPendingMessages(accountId, mControllerCallback); + if (mMailboxId == Mailbox.QUERY_ALL_OUTBOX) { + // For the combined Outbox, we loop through all accounts and send the messages + Cursor c = mResolver.query(Account.CONTENT_URI, Account.ID_PROJECTION, + null, null, null); + try { + while (c.moveToNext()) { + long accountId = c.getLong(Account.ID_PROJECTION_COLUMN); + mController.sendPendingMessages(accountId, mControllerCallback); + } + } finally { + c.close(); + } + } else { + long accountId = lookupAccountIdFromMailboxId(mMailboxId); + mController.sendPendingMessages(accountId, mControllerCallback); + } } private void onDelete(long messageId, long accountId) {