Fix search mailbox status on early-out when searching

b/17109656

Change-Id: I8ff643d57a461d81519da65d017c8c3cc95c5659
This commit is contained in:
Tony Mantler 2014-08-22 14:28:41 -07:00
parent 473ce1fa35
commit 207a35f174
1 changed files with 4 additions and 0 deletions

View File

@ -1505,6 +1505,10 @@ public class ImapService extends Service {
Math.min(numSearchResults - searchParams.mOffset, searchParams.mLimit);
destMailbox.updateMessageCount(context, numSearchResults);
if (numToLoad <= 0) {
// Tell UI that we're done loading messages
statusValues.put(Mailbox.SYNC_TIME, System.currentTimeMillis());
statusValues.put(Mailbox.UI_SYNC_STATUS, UIProvider.SyncStatus.NO_SYNC);
destMailbox.update(context, statusValues);
return 0;
}