am c9f92395: am 468fe91d: Prevent account reconcile from running when service is down

Merge commit 'c9f923959eb7987db4f12dc7e2a1103e600d9eeb' into kraken

* commit 'c9f923959eb7987db4f12dc7e2a1103e600d9eeb':
  Prevent account reconcile from running when service is down
This commit is contained in:
Marc Blank 2010-04-30 11:55:44 -07:00 committed by Android Git Automerger
commit 017aeb6dc1

View File

@ -954,14 +954,16 @@ public class SyncManager extends Service implements Runnable {
android.accounts.Account[] accountMgrList = AccountManager.get(syncManager) android.accounts.Account[] accountMgrList = AccountManager.get(syncManager)
.getAccountsByType(Email.EXCHANGE_ACCOUNT_MANAGER_TYPE); .getAccountsByType(Email.EXCHANGE_ACCOUNT_MANAGER_TYPE);
synchronized (sAccountList) { synchronized (sAccountList) {
// Make sure we have an up-to-date sAccountList // Make sure we have an up-to-date sAccountList. If not (for example, if the
// service has been destroyed), we would be reconciling against an empty account
// list, which would cause the deletion of all of our accounts
if (mAccountObserver != null) { if (mAccountObserver != null) {
mAccountObserver.onAccountChanged(); mAccountObserver.onAccountChanged();
}
reconcileAccountsWithAccountManager(syncManager, sAccountList, reconcileAccountsWithAccountManager(syncManager, sAccountList,
accountMgrList, false, mResolver); accountMgrList, false, mResolver);
} }
} }
}
}.start(); }.start();
} }