Merge change 27394 into eclair

* changes:
  Fix race condition NPE in medium tests (#2148940)
This commit is contained in:
Android (Google) Code Review 2009-09-27 23:56:33 -04:00
commit c05a48591e

View File

@ -1397,12 +1397,14 @@ public class SyncManager extends Service implements Runnable {
if (mConnectivityReceiver != null) {
unregisterReceiver(mConnectivityReceiver);
}
ContentResolver resolver = getContentResolver();
resolver.unregisterContentObserver(mAccountObserver);
resolver.unregisterContentObserver(mMailboxObserver);
resolver.unregisterContentObserver(mSyncedMessageObserver);
resolver.unregisterContentObserver(mMessageObserver);
if (INSTANCE != null) {
ContentResolver resolver = getContentResolver();
resolver.unregisterContentObserver(mAccountObserver);
resolver.unregisterContentObserver(mMailboxObserver);
resolver.unregisterContentObserver(mSyncedMessageObserver);
resolver.unregisterContentObserver(mMessageObserver);
}
// Don't leak the Intent associated with this listener
if (mAccountsUpdatedListener != null) {
AccountManager.get(this).removeOnAccountsUpdatedListener(mAccountsUpdatedListener);