am 7cb5e144: Merge "Add checks for null in SyncManager" into froyo

Merge commit '7cb5e144e746b5310d8f9facc24ab992f1a2a67c' into froyo-plus-aosp

* commit '7cb5e144e746b5310d8f9facc24ab992f1a2a67c':
  Add checks for null in SyncManager
This commit is contained in:
Marc Blank 2010-04-23 17:21:46 -07:00 committed by Android Git Automerger
commit b11ea045e9

View File

@ -534,6 +534,7 @@ public class SyncManager extends Service implements Runnable {
// An account has changed // An account has changed
Account updatedAccount = Account.restoreAccountWithId(context, Account updatedAccount = Account.restoreAccountWithId(context,
account.mId); account.mId);
if (updatedAccount == null) continue;
if (account.mSyncInterval != updatedAccount.mSyncInterval if (account.mSyncInterval != updatedAccount.mSyncInterval
|| account.mSyncLookback != updatedAccount.mSyncLookback) { || account.mSyncLookback != updatedAccount.mSyncLookback) {
// Set pushable boxes' interval to the interval of the Account // Set pushable boxes' interval to the interval of the Account
@ -563,13 +564,14 @@ public class SyncManager extends Service implements Runnable {
// Look for new accounts // Look for new accounts
for (Account account : currentAccounts) { for (Account account : currentAccounts) {
if (!sAccountList.contains(account.mId)) { if (!sAccountList.contains(account.mId)) {
// This is an addition; create our magic hidden mailbox...
log("Account observer found new account: " + account.mDisplayName);
addAccountMailbox(account.mId);
// Don't forget to cache the HostAuth // Don't forget to cache the HostAuth
HostAuth ha = HostAuth.restoreHostAuthWithId(getContext(), HostAuth ha = HostAuth.restoreHostAuthWithId(getContext(),
account.mHostAuthKeyRecv); account.mHostAuthKeyRecv);
if (ha == null) continue;
account.mHostAuthRecv = ha; account.mHostAuthRecv = ha;
// This is an addition; create our magic hidden mailbox...
log("Account observer found new account: " + account.mDisplayName);
addAccountMailbox(account.mId);
sAccountList.add(account); sAccountList.add(account);
mSyncableEasMailboxSelector = null; mSyncableEasMailboxSelector = null;
mEasAccountSelector = null; mEasAccountSelector = null;