Make EAS Email syncable after GB/HC -> ICS upgrade

* In the same upgrade step in which we add AccountManager accounts
  to IMAP/POP accounts, we now make Email syncable for EAS accounts
* This step is hit by all users upgrading from GB/HC -> ICS

Bug: 5582884

Change-Id: I11a06e2ad72ffed20c31f5d8be81705642f552a5
This commit is contained in:
Marc Blank 2011-11-08 08:29:53 -08:00
parent 1b6e1ae306
commit 8ff1842ab1

View File

@ -2496,6 +2496,17 @@ outer:
createAccountManagerAccount(accountManagerContext, createAccountManagerAccount(accountManagerContext,
accountCursor.getString(V21_ACCOUNT_EMAIL), accountCursor.getString(V21_ACCOUNT_EMAIL),
hostAuthCursor.getString(V21_HOSTAUTH_PASSWORD)); hostAuthCursor.getString(V21_HOSTAUTH_PASSWORD));
// If an EAS account, make Email sync automatically (equivalent of
// checking the "Sync Email" box in settings
} else if (HostAuth.SCHEME_EAS.equals(protocol)) {
android.accounts.Account amAccount =
new android.accounts.Account(
accountCursor.getString(V21_ACCOUNT_EMAIL),
AccountManagerTypes.TYPE_POP_IMAP);
ContentResolver.setIsSyncable(amAccount, EmailContent.AUTHORITY, 1);
ContentResolver.setSyncAutomatically(amAccount,
EmailContent.AUTHORITY, true);
} }
} }
} finally { } finally {