diff --git a/src/com/android/email/provider/AccountReconciler.java b/src/com/android/email/provider/AccountReconciler.java index 45d3b9ccd..96325fa8c 100644 --- a/src/com/android/email/provider/AccountReconciler.java +++ b/src/com/android/email/provider/AccountReconciler.java @@ -110,9 +110,9 @@ public class AccountReconciler { * @return Whether the account is in the list. */ private static boolean hasAmAccount(final List accounts, - final String name) { + final String name, final String type) { for (final android.accounts.Account account : accounts) { - if (account.name.equalsIgnoreCase(name)) { + if (account.name.equalsIgnoreCase(name) && account.type.equalsIgnoreCase(type)) { return true; } } @@ -154,7 +154,10 @@ public class AccountReconciler { // AccountManager account for (final Account providerAccount : emailProviderAccounts) { final String providerAccountName = providerAccount.mEmailAddress; - if (!hasAmAccount(accountManagerAccounts, providerAccountName)) { + final String providerAccountType = + EmailServiceUtils.getServiceInfoForAccount(context, providerAccount.mId) + .accountType; + if (!hasAmAccount(accountManagerAccounts, providerAccountName, providerAccountType)) { if ((providerAccount.mFlags & Account.FLAGS_INCOMPLETE) != 0) { LogUtils.w(Logging.LOG_TAG, "Account reconciler noticed incomplete account; ignoring");