am 802bf1b4: Ignore Messsages With No Timestamp

* commit '802bf1b4a7e36caa84d790198abc8421873b821c':
  Ignore Messsages With No Timestamp
This commit is contained in:
Alon Albert 2013-11-08 16:57:25 -08:00 committed by Android Git Automerger
commit 0a4debe0a5

View File

@ -372,10 +372,12 @@ public class ImapService extends Service {
endDate = System.currentTimeMillis() - FULL_SYNC_WINDOW_MILLIS; endDate = System.currentTimeMillis() - FULL_SYNC_WINDOW_MILLIS;
Cursor localOldestCursor = null; Cursor localOldestCursor = null;
try { try {
// b/11520812 Ignore message with timestamp = 0 (which includes NULL)
localOldestCursor = resolver.query(EmailContent.Message.CONTENT_URI, localOldestCursor = resolver.query(EmailContent.Message.CONTENT_URI,
OldestTimestampInfo.PROJECTION, OldestTimestampInfo.PROJECTION,
EmailContent.MessageColumns.ACCOUNT_KEY + "=?" + " AND " + EmailContent.MessageColumns.ACCOUNT_KEY + "=?" + " AND " +
MessageColumns.MAILBOX_KEY + "=?", MessageColumns.MAILBOX_KEY + "=? AND " +
MessageColumns.TIMESTAMP + "!=0",
new String[] {String.valueOf(account.mId), String.valueOf(mailbox.mId)}, new String[] {String.valueOf(account.mId), String.valueOf(mailbox.mId)},
null); null);
if (localOldestCursor != null && localOldestCursor.moveToFirst()) { if (localOldestCursor != null && localOldestCursor.moveToFirst()) {