summaryrefslogtreecommitdiffstats
path: root/emailsync/src
diff options
context:
space:
mode:
Diffstat (limited to 'emailsync/src')
-rw-r--r--emailsync/src/com/android/emailsync/SyncManager.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/emailsync/src/com/android/emailsync/SyncManager.java b/emailsync/src/com/android/emailsync/SyncManager.java
index 7cb826ea0..0f1ed3b0c 100644
--- a/emailsync/src/com/android/emailsync/SyncManager.java
+++ b/emailsync/src/com/android/emailsync/SyncManager.java
@@ -1214,6 +1214,7 @@ public abstract class SyncManager extends Service implements Runnable {
private void stopPing(long accountId) {
// Go through our active mailboxes looking for the right one
synchronized (sSyncLock) {
+ AbstractSyncService serviceToReset = null;
for (long mailboxId: mServiceMap.keySet()) {
Mailbox m = Mailbox.restoreMailboxWithId(this, mailboxId);
if (m != null) {
@@ -1221,11 +1222,14 @@ public abstract class SyncManager extends Service implements Runnable {
if (m.mAccountKey == accountId && serverId != null &&
m.mType == Mailbox.TYPE_EAS_ACCOUNT_MAILBOX) {
// Here's our account mailbox; reset him (stopping pings)
- AbstractSyncService svc = mServiceMap.get(mailboxId);
- svc.reset();
+ serviceToReset = mServiceMap.get(mailboxId);
+ break;
}
}
}
+ if (serviceToReset != null) {
+ serviceToReset.reset();
+ }
}
}