Show "no messages" when list is empty.

Fixes b/8547230.

Change-Id: I7d9d00c9448f1222d38a1a6406709818b2523ceb
This commit is contained in:
Andrew Sapperstein 2013-05-15 11:58:53 -07:00
parent b8d7d8d31d
commit fff905416f

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);
}
}