Show "sync contacts" setting properly in the settings page

Change-Id: I9c198e7795a8f2ea348361092eae22c8ff22a1a0
This commit is contained in:
Marc Blank 2009-09-21 10:39:10 -07:00
parent c06b6290c7
commit 7b79163aac

View File

@ -247,9 +247,8 @@ public class AccountSettings extends PreferenceActivity {
mSyncContacts = (CheckBoxPreference) findPreference(PREFERENCE_SYNC_CONTACTS);
if (mAccount.mHostAuthRecv.mProtocol.equals("eas")) {
String login = mAccount.mHostAuthRecv.mLogin;
android.accounts.Account acct =
new android.accounts.Account(login, Eas.ACCOUNT_MANAGER_TYPE);
new android.accounts.Account(mAccount.mEmailAddress, Eas.ACCOUNT_MANAGER_TYPE);
mSyncContacts.setChecked(ContentResolver
.getSyncAutomatically(acct, ContactsContract.AUTHORITY));
} else {
@ -319,9 +318,8 @@ public class AccountSettings extends PreferenceActivity {
mAccount.setFlags(newFlags);
if (mAccount.mHostAuthRecv.mProtocol.equals("eas")) {
String login = mAccount.mHostAuthRecv.mLogin;
android.accounts.Account acct =
new android.accounts.Account(login, Eas.ACCOUNT_MANAGER_TYPE);
new android.accounts.Account(mAccount.mEmailAddress, Eas.ACCOUNT_MANAGER_TYPE);
ContentResolver.setSyncAutomatically(acct, ContactsContract.AUTHORITY,
mSyncContacts.isChecked());