When loading local messages, don't filter messages by time

b/10508861
Temporary fix for this.
For some reason, we're getting messages loaded with the wrong
date being stored. If we have a message with date = 0, and we
filter out anything older than 24 hours, then these messages
with the wrong date won't get loaded into our localMessageMap.
Then we won't recognize that message is already present locally,
and we will fetch a duplicate.
I don't yet know why we're getting the date wrong.

Change-Id: Ic91cd263198ee944eddbaf1d90080e8285a5df6a
This commit is contained in:
Martin Hibdon 2013-08-27 15:40:32 -07:00
parent 7be030ec8e
commit 0c8df56a0a
1 changed files with 6 additions and 1 deletions

View File

@ -518,7 +518,12 @@ public class ImapService extends Service {
Cursor localUidCursor = null;
HashMap<String, LocalMessageInfo> localMessageMap = new HashMap<String, LocalMessageInfo>();
try {
final long queryEndDate = endDate - DateUtils.DAY_IN_MILLIS - DateUtils.HOUR_IN_MILLIS;
// FLAG: There is a problem that causes us to store the wrong date on some messages,
// so messages get a date of zero. If we filter these messages out and don't put them
// in our localMessageMap, then we'll end up loading the same message again.
// See b/10508861
// final long queryEndDate = endDate - DateUtils.DAY_IN_MILLIS - DateUtils.HOUR_IN_MILLIS;
final long queryEndDate = 0;
localUidCursor = resolver.query(
EmailContent.Message.CONTENT_URI,
LocalMessageInfo.PROJECTION,