From 7041dc5d1b4e231c7ee51a76b0dd02f5525ac51d Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sun, 20 Sep 2009 14:56:02 -0700 Subject: [PATCH] Reconnect Settings -> Accounts to Email account settings screen * This was broken during the AccountManager naming reversion Change-Id: Ib2ccc9ca187ffdaf4a978c3c8111808be50d1583 --- .../email/activity/setup/AccountSettings.java | 29 ++++--------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/src/com/android/email/activity/setup/AccountSettings.java b/src/com/android/email/activity/setup/AccountSettings.java index 056934a9a..5a8bf7831 100644 --- a/src/com/android/email/activity/setup/AccountSettings.java +++ b/src/com/android/email/activity/setup/AccountSettings.java @@ -24,7 +24,6 @@ import com.android.email.mail.Store; import com.android.email.provider.EmailContent.Account; import com.android.email.provider.EmailContent.AccountColumns; import com.android.email.provider.EmailContent.HostAuth; -import com.android.email.provider.EmailContent.HostAuthColumns; import com.android.exchange.Eas; import android.app.Activity; @@ -264,30 +263,14 @@ public class AccountSettings extends PreferenceActivity { // First, get the AccountManager account that we've been ask to handle android.accounts.Account acct = (android.accounts.Account)getIntent() - .getParcelableExtra(ACCOUNT_MANAGER_EXTRA_ACCOUNT); - // Find a HostAuth using eas and whose login is the name of the AccountManager account - Cursor c = getContentResolver().query(HostAuth.CONTENT_URI, - new String[] {HostAuthColumns.ID}, HostAuth.LOGIN + "=? AND " - + HostAuthColumns.PROTOCOL + "=?", - new String[] {acct.name, "eas"}, null); + .getParcelableExtra(ACCOUNT_MANAGER_EXTRA_ACCOUNT); + // Find a HostAuth using eas and whose login is klthe name of the AccountManager account + Cursor c = getContentResolver().query(Account.CONTENT_URI, + new String[] {AccountColumns.ID}, AccountColumns.EMAIL_ADDRESS + "=?", + new String[] {acct.name}, null); try { if (c.moveToFirst()) { - // This gives us the HostAuth's id - String hostAuthId = c.getString(0); - // Now, find the EmailProvider Account for this HostAuth - Cursor ac = getContentResolver().query(Account.CONTENT_URI, - new String[] {AccountColumns.ID}, - AccountColumns.HOST_AUTH_KEY_RECV + "=? OR " - + AccountColumns.HOST_AUTH_KEY_SEND + "=?", - new String[] {hostAuthId, hostAuthId}, null); - try { - // And if we find one, set mAccountId accordingly - if (ac.moveToFirst()) { - mAccountId = ac.getLong(0); - } - } finally { - ac.close(); - } + mAccountId = c.getLong(0); } } finally { c.close();