On initial sync, do inbox first

b/11081520
This improves perceived performance, the inbox
messages will come in before contacts and calendar

Change-Id: Icd9630d9cd2fb79a54d0ed2c11702a1a3091ed7e
This commit is contained in:
Martin Hibdon 2013-10-04 15:30:22 -07:00
parent cae08a64fb
commit 6700000ad1
1 changed files with 4 additions and 1 deletions

View File

@ -810,9 +810,12 @@ public class Mailbox extends EmailContent implements MailboxColumns, Parcelable
* @return A cursor (with one column, containing ids) with all mailbox ids we should sync.
*/
public static Cursor getMailboxIdsForSync(final ContentResolver cr, final long accountId) {
// We're sorting by mailbox type. The reason is that the inbox is type 0, other types
// (e.g. Calendar and Contacts) are all higher numbers. Upon initial sync, we'd like to
// sync the inbox first to improve perceived performance.
return cr.query(Mailbox.CONTENT_URI, Mailbox.ID_PROJECTION,
OUTBOX_PLUS_SYNCING_AND_ACCOUNT_SELECTION,
new String[] { Long.toString(accountId) }, null);
new String[] { Long.toString(accountId) }, MailboxColumns.TYPE + " ASC");
}
/**