am 7b79163a: Show "sync contacts" setting properly in the settings page

Merge commit '7b79163aac1542577304d60fa76de6feb6be48c7' into eclair-plus-aosp

* commit '7b79163aac1542577304d60fa76de6feb6be48c7':
  Show "sync contacts" setting properly in the settings page
This commit is contained in:
Marc Blank 2009-09-21 10:47:45 -07:00 committed by Android Git Automerger
commit 009f325ea6

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());