From 2651bcc7be2c5fbce23faa0b0d12db63caee5a45 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 5 Sep 2012 09:49:55 -0700 Subject: [PATCH] Put combined account last Bug: 7100404 Change-Id: Iff2884e635d030d840f297c15f5e2ee646185c5f --- src/com/android/email/imap2/Imap2SyncService.java | 7 +++++++ src/com/android/email/provider/EmailProvider.java | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/com/android/email/imap2/Imap2SyncService.java b/src/com/android/email/imap2/Imap2SyncService.java index 33cb78c42..3faf71f62 100644 --- a/src/com/android/email/imap2/Imap2SyncService.java +++ b/src/com/android/email/imap2/Imap2SyncService.java @@ -1713,6 +1713,12 @@ public class Imap2SyncService extends AbstractSyncService { mResolver.update(ContentUris.withAppendedId(Mailbox.CONTENT_URI, id), values, null, null); } + public void setMailboxLastSyncResult(long id, int result) { + ContentValues values = new ContentValues(); + values.put(Mailbox.UI_LAST_SYNC_RESULT, result); + mResolver.update(ContentUris.withAppendedId(Mailbox.CONTENT_URI, id), values, null, null); + } + /** * Reset the sync interval for this mailbox (account if it's Inbox) */ @@ -1764,6 +1770,7 @@ public class Imap2SyncService extends AbstractSyncService { mSocket.setSoTimeout(IDLE_ASLEEP_MILLIS + (1*MINS)); // Say we're no longer syncing (turn off indeterminate progress in the UI) setMailboxSyncStatus(mMailboxId, UIProvider.SyncStatus.NO_SYNC); + setMailboxLastSyncResult(mMailboxId, UIProvider.LastSyncResult.SUCCESS); // Set an alarm for one minute before our timeout our expected IDLE time Imap2SyncManager.runAsleep(mMailboxId, IDLE_ASLEEP_MILLIS); diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 1d7b97bb6..b79b535fa 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -3065,6 +3065,9 @@ outer: } accountCursor.close(); } + if (combinedAccount) { + addCombinedAccountRow(mc); + } } finally { accountIdCursor.close(); }