From 0c8df56a0aed5b97aee2031ccbce75762097b1d1 Mon Sep 17 00:00:00 2001 From: Martin Hibdon Date: Tue, 27 Aug 2013 15:40:32 -0700 Subject: [PATCH] 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 --- src/com/android/email/service/ImapService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/service/ImapService.java b/src/com/android/email/service/ImapService.java index bc40ca1be..0c73acd1c 100644 --- a/src/com/android/email/service/ImapService.java +++ b/src/com/android/email/service/ImapService.java @@ -518,7 +518,12 @@ public class ImapService extends Service { Cursor localUidCursor = null; HashMap localMessageMap = new HashMap(); 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,