am fff90541: Show "no messages" when list is empty.

* commit 'fff905416f2f786f0483dc627af04524d81a76ab':
  Show "no messages" when list is empty.
This commit is contained in:
Andrew Sapperstein 2013-05-15 13:11:28 -07:00 committed by Android Git Automerger
commit fe61a53ff7

View File

@ -3098,13 +3098,21 @@ public class EmailProvider extends ContentProvider {
mMailboxId = mailboxId;
mContext = context;
Mailbox mailbox = Mailbox.restoreMailboxWithId(context, mailboxId);
// We assume that all message lists are complete
// since we don't do any live lists in email.
mExtras.putInt(UIProvider.CursorExtraKeys.EXTRA_STATUS,
UIProvider.CursorStatus.COMPLETE);
if (mailbox != null) {
mExtras.putInt(UIProvider.CursorExtraKeys.EXTRA_STATUS, mailbox.mUiSyncStatus);
if (mailbox.mUiLastSyncResult != UIProvider.LastSyncResult.SUCCESS) {
mExtras.putInt(UIProvider.CursorExtraKeys.EXTRA_ERROR,
mailbox.mUiLastSyncResult);
}
mExtras.putInt(UIProvider.CursorExtraKeys.EXTRA_ERROR,
mailbox.mUiLastSyncResult);
mExtras.putInt(UIProvider.CursorExtraKeys.EXTRA_TOTAL_COUNT, mailbox.mTotalCount);
} else {
// TODO for virtual mailboxes, we may want to do something besides just fake it
mExtras.putInt(UIProvider.CursorExtraKeys.EXTRA_ERROR,
UIProvider.LastSyncResult.SUCCESS);
mExtras.putInt(UIProvider.CursorExtraKeys.EXTRA_TOTAL_COUNT,
cursor != null ? cursor.getCount() : 0);
}
}