summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohit Yengisetty <rohit@cyngn.com>2015-07-28 10:19:24 -0700
committerMarcos Marado <mmarado@cyngn.com>2015-09-11 04:59:56 -0700
commit9e150c0a1f5d6a2316ba2cb9a7bfc6e8aa5ad244 (patch)
treea01925dc8d7d026c4c3443d640cdcdb0b1f132e2
parent4e385ceb524ad01cf5432c48290b44a9014997ad (diff)
downloadandroid_packages_apps_ContactsCommon-9e150c0a1f5d6a2316ba2cb9a7bfc6e8aa5ad244.tar.gz
android_packages_apps_ContactsCommon-9e150c0a1f5d6a2316ba2cb9a7bfc6e8aa5ad244.tar.bz2
android_packages_apps_ContactsCommon-9e150c0a1f5d6a2316ba2cb9a7bfc6e8aa5ad244.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 (cherry picked from commit f28f4ef80548ef76a0565bcd9f329a5b21c3eef0)
-rw-r--r--src/com/android/contacts/common/util/AccountSelectionUtil.java2
-rw-r--r--src/com/android/contacts/common/vcard/SelectAccountActivity.java20
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();
}
};