am 3e8e5979: Null Protect Account Info

* commit '3e8e59798b718e034da8c250e706e6429c41c2a5':
  Null Protect Account Info
This commit is contained in:
Alon Albert 2013-10-29 17:04:46 -07:00 committed by Android Git Automerger
commit 3ffffaffe8
1 changed files with 10 additions and 5 deletions

View File

@ -154,11 +154,16 @@ public class AccountReconciler {
// AccountManager account
for (final Account providerAccount : emailProviderAccounts) {
final String providerAccountName = providerAccount.mEmailAddress;
final String providerAccountType =
EmailServiceUtils.getServiceInfoForAccount(context, providerAccount.mId)
.accountType;
if (!hasAmAccount(accountManagerAccounts, providerAccountName, providerAccountType)) {
if ((providerAccount.mFlags & Account.FLAGS_INCOMPLETE) != 0) {
final EmailServiceUtils.EmailServiceInfo infoForAccount = EmailServiceUtils
.getServiceInfoForAccount(context, providerAccount.mId);
// We want to delete the account if there is no matching Account Manager account for it
// unless it is flagged as incomplete. We also want to delete it if we can't find
// an accountInfo object for it.
if (infoForAccount == null || !hasAmAccount(
accountManagerAccounts, providerAccountName, infoForAccount.accountType)) {
if (infoForAccount != null &&
(providerAccount.mFlags & Account.FLAGS_INCOMPLETE) != 0) {
LogUtils.w(Logging.LOG_TAG,
"Account reconciler noticed incomplete account; ignoring");
continue;