From 8ff1842ab123721b66f2ed1e14e92244a51b0b99 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Tue, 8 Nov 2011 08:29:53 -0800 Subject: [PATCH] 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 --- src/com/android/email/provider/EmailProvider.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 59acee112..287590256 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -2496,6 +2496,17 @@ outer: createAccountManagerAccount(accountManagerContext, accountCursor.getString(V21_ACCOUNT_EMAIL), 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 {