diff options
author | Rohit Yengisetty <rohit@cyngn.com> | 2015-07-28 10:19:24 -0700 |
---|---|---|
committer | Rohit Yengisetty <rohit@cyngn.com> | 2015-08-19 16:17:05 -0700 |
commit | f28f4ef80548ef76a0565bcd9f329a5b21c3eef0 (patch) | |
tree | 851b17bb202ef4d267b58449d0a5a8d4778fb489 | |
parent | 160f4dc6ef752b7d100de1df73a530109d83269c (diff) | |
download | android_packages_apps_ContactsCommon-f28f4ef80548ef76a0565bcd9f329a5b21c3eef0.tar.gz android_packages_apps_ContactsCommon-f28f4ef80548ef76a0565bcd9f329a5b21c3eef0.tar.bz2 android_packages_apps_ContactsCommon-f28f4ef80548ef76a0565bcd9f329a5b21c3eef0.zip |
SelectAccountActivity : Support local phone account
Selecting the local phone account wasn't doing anything. An issue
was reported wherein importing vcf file to local phone account
doesn't work. ImportVCardActivity doesn't get the local phone account
even though the user selected it in account-selection dialog.
[CYNGNOS-399]
Change-Id: Ie7534e1046c29b96807735c1caa307acca3de66b
-rw-r--r-- | src/com/android/contacts/common/util/AccountSelectionUtil.java | 2 | ||||
-rw-r--r-- | src/com/android/contacts/common/vcard/SelectAccountActivity.java | 20 |
2 files changed, 7 insertions, 15 deletions
diff --git a/src/com/android/contacts/common/util/AccountSelectionUtil.java b/src/com/android/contacts/common/util/AccountSelectionUtil.java index 380e6243..055be2a9 100644 --- a/src/com/android/contacts/common/util/AccountSelectionUtil.java +++ b/src/com/android/contacts/common/util/AccountSelectionUtil.java @@ -131,7 +131,7 @@ public class AccountSelectionUtil { DialogInterface.OnClickListener onClickListener, DialogInterface.OnCancelListener onCancelListener, boolean includeSIM) { final AccountTypeManager accountTypes = AccountTypeManager.getInstance(context); - List<AccountWithDataSet> writableAccountList = accountTypes.getAccounts(true); + List<AccountWithDataSet> writableAccountList; if (includeSIM) { writableAccountList = accountTypes.getAccounts(true); } else { diff --git a/src/com/android/contacts/common/vcard/SelectAccountActivity.java b/src/com/android/contacts/common/vcard/SelectAccountActivity.java index eef6b467..04956708 100644 --- a/src/com/android/contacts/common/vcard/SelectAccountActivity.java +++ b/src/com/android/contacts/common/vcard/SelectAccountActivity.java @@ -69,11 +69,6 @@ public class SelectAccountActivity extends Activity { Log.i(LOG_TAG, "The number of available accounts: " + accountList.size()); - // Add the local storage account to allow user to store its contacts in the phone - AccountWithDataSet localAccount = new AccountWithDataSet( - PhoneAccountType.ACCOUNT_NAME, PhoneAccountType.ACCOUNT_TYPE, null); - accountList.add(0, localAccount); - // Multiple accounts. Let users to select one. mAccountSelectionListener = new AccountSelectionUtil.AccountSelectedListener( @@ -81,15 +76,12 @@ public class SelectAccountActivity extends Activity { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); - // Position 0 contains the phone-local account - if (which > 0) { - final AccountWithDataSet account = mAccountList.get(which); - final Intent intent = new Intent(); - intent.putExtra(ACCOUNT_NAME, account.name); - intent.putExtra(ACCOUNT_TYPE, account.type); - intent.putExtra(DATA_SET, account.dataSet); - setResult(RESULT_OK, intent); - } + final AccountWithDataSet account = mAccountList.get(which); + final Intent intent = new Intent(); + intent.putExtra(ACCOUNT_NAME, account.name); + intent.putExtra(ACCOUNT_TYPE, account.type); + intent.putExtra(DATA_SET, account.dataSet); + setResult(RESULT_OK, intent); finish(); } }; |