am 200adbe9: am 14c08377: am 06e38818: am f9757504: Merge "Reload settings immediately after toggling sync" into ub-gmail-ur14-dev

* commit '200adbe935ffc182994ec2df341b4bed86e1272a':
  Reload settings immediately after toggling sync
This commit is contained in:
Tony Mantler 2014-11-02 18:53:28 +00:00 committed by Android Git Automerger
commit 5249a10e8c

View File

@ -367,16 +367,19 @@ public class AccountSettingsFragment extends MailAccountPrefsFragment
mAccount.mEmailAddress, mServiceInfo.accountType); mAccount.mEmailAddress, mServiceInfo.accountType);
ContentResolver.setSyncAutomatically(androidAcct, EmailContent.AUTHORITY, ContentResolver.setSyncAutomatically(androidAcct, EmailContent.AUTHORITY,
(Boolean) newValue); (Boolean) newValue);
loadSettings();
} else if (key.equals(PREFERENCE_SYNC_CONTACTS)) { } else if (key.equals(PREFERENCE_SYNC_CONTACTS)) {
final android.accounts.Account androidAcct = new android.accounts.Account( final android.accounts.Account androidAcct = new android.accounts.Account(
mAccount.mEmailAddress, mServiceInfo.accountType); mAccount.mEmailAddress, mServiceInfo.accountType);
ContentResolver.setSyncAutomatically(androidAcct, ContactsContract.AUTHORITY, ContentResolver.setSyncAutomatically(androidAcct, ContactsContract.AUTHORITY,
(Boolean) newValue); (Boolean) newValue);
loadSettings();
} else if (key.equals(PREFERENCE_SYNC_CALENDAR)) { } else if (key.equals(PREFERENCE_SYNC_CALENDAR)) {
final android.accounts.Account androidAcct = new android.accounts.Account( final android.accounts.Account androidAcct = new android.accounts.Account(
mAccount.mEmailAddress, mServiceInfo.accountType); mAccount.mEmailAddress, mServiceInfo.accountType);
ContentResolver.setSyncAutomatically(androidAcct, CalendarContract.AUTHORITY, ContentResolver.setSyncAutomatically(androidAcct, CalendarContract.AUTHORITY,
(Boolean) newValue); (Boolean) newValue);
loadSettings();
} else if (key.equals(PREFERENCE_BACKGROUND_ATTACHMENTS)) { } else if (key.equals(PREFERENCE_BACKGROUND_ATTACHMENTS)) {
int newFlags = mAccount.getFlags() & ~(Account.FLAGS_BACKGROUND_ATTACHMENTS); int newFlags = mAccount.getFlags() & ~(Account.FLAGS_BACKGROUND_ATTACHMENTS);