From f50c6d1fafde92f38ad80b36bb152cc58228a474 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sat, 12 Sep 2009 16:45:47 -0700 Subject: [PATCH] Don't sync "trash" folder in Exchange Change-Id: I6a1dc2a8ae5936bb7428d82e48ddbf114500051a --- src/com/android/exchange/SyncManager.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/com/android/exchange/SyncManager.java b/src/com/android/exchange/SyncManager.java index 986946ae4..a026b98d0 100644 --- a/src/com/android/exchange/SyncManager.java +++ b/src/com/android/exchange/SyncManager.java @@ -1351,7 +1351,8 @@ public class SyncManager extends Service implements Runnable { syncError.holdEndTime = 0; } } - long freq = c.getInt(Mailbox.CONTENT_SYNC_INTERVAL_COLUMN); + + // We handle a few types of mailboxes specially int type = c.getInt(Mailbox.CONTENT_TYPE_COLUMN); if (type == Mailbox.TYPE_CONTACTS) { // See if "sync automatically" is set @@ -1366,8 +1367,13 @@ public class SyncManager extends Service implements Runnable { continue; } } + } else if (type == Mailbox.TYPE_TRASH) { + continue; } - if (freq == Mailbox.CHECK_INTERVAL_PUSH) { + + // Otherwise, we use the sync interval + long interval = c.getInt(Mailbox.CONTENT_SYNC_INTERVAL_COLUMN); + if (interval == Mailbox.CHECK_INTERVAL_PUSH) { Mailbox m = EmailContent.getContent(c, Mailbox.class); startService(m, SYNC_PUSH, null); } else if (type == Mailbox.TYPE_OUTBOX) { @@ -1378,9 +1384,9 @@ public class SyncManager extends Service implements Runnable { Mailbox m = EmailContent.getContent(c, Mailbox.class); startService(new EasOutboxService(this, m), m); } - } else if (freq > 0 && freq <= ONE_DAY_MINUTES) { + } else if (interval > 0 && interval <= ONE_DAY_MINUTES) { long lastSync = c.getLong(Mailbox.CONTENT_SYNC_TIME_COLUMN); - long toNextSync = freq*MINUTES - (now - lastSync); + long toNextSync = interval*MINUTES - (now - lastSync); if (toNextSync <= 0) { Mailbox m = EmailContent.getContent(c, Mailbox.class); startService(m, SYNC_SCHEDULED, null);