From c1b8efad5070f3da424c4903910335d8ef2b98bb Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Tue, 20 Oct 2009 10:51:08 -0700 Subject: [PATCH] Fix #2159410 (side-effect of unexpected account deletion) Change-Id: Icabbe5fe5c417ff72b542eff7a54c658814d482b --- src/com/android/exchange/SyncManager.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/android/exchange/SyncManager.java b/src/com/android/exchange/SyncManager.java index 7c372b330..ce71e842e 100644 --- a/src/com/android/exchange/SyncManager.java +++ b/src/com/android/exchange/SyncManager.java @@ -727,7 +727,7 @@ public class SyncManager extends Service implements Runnable { static public String getDeviceId() throws IOException { return getDeviceId(null); } - + static public synchronized String getDeviceId(Context context) throws IOException { if (sDeviceId != null) { return sDeviceId; @@ -766,10 +766,10 @@ public class SyncManager extends Service implements Runnable { } /** - * Note that there are two ways the EAS SyncManager service can be created: + * Note that there are two ways the EAS SyncManager service can be created: * - * 1) as a background service instantiated via startService (which happens on boot, when the - * first EAS account is created, etc), in which case the service thread is spun up, mailboxes + * 1) as a background service instantiated via startService (which happens on boot, when the + * first EAS account is created, etc), in which case the service thread is spun up, mailboxes * sync, etc. and * 2) to execute an RPC call from the UI, in which case the background service will already be * running most of the time (unless we're creating a first EAS account) @@ -835,6 +835,7 @@ public class SyncManager extends Service implements Runnable { mSyncedMessageObserver = null; mMessageObserver = null; mSyncStatusObserver = null; + mAccountsUpdatedListener = null; } } @@ -861,7 +862,7 @@ public class SyncManager extends Service implements Runnable { INSTANCE.startService(new Intent(INSTANCE, SyncManager.class)); } } - + static public ConnPerRoute sConnPerRoute = new ConnPerRoute() { public int getMaxForRoute(HttpRoute route) { return 8; @@ -1448,7 +1449,7 @@ public class SyncManager extends Service implements Runnable { if (mConnectivityReceiver != null) { unregisterReceiver(mConnectivityReceiver); } - + if (INSTANCE != null) { ContentResolver resolver = getContentResolver(); resolver.unregisterContentObserver(mAccountObserver);