summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2014-02-09 03:25:06 +0100
committerDan Pasanen <dan.pasanen@gmail.com>2017-03-16 16:14:40 +0000
commit24227ad4d2d75213bc0f548d896c35c0e1385a48 (patch)
treee479f3dc5d4ccd2347ce31821080e9806cbc60e0
parentf6e64425da8fe7dceb57f334e3cd7b86ca5266d9 (diff)
downloadpackages_apps_Contacts-24227ad4d2d75213bc0f548d896c35c0e1385a48.tar.gz
packages_apps_Contacts-24227ad4d2d75213bc0f548d896c35c0e1385a48.tar.bz2
packages_apps_Contacts-24227ad4d2d75213bc0f548d896c35c0e1385a48.zip
contacts: Add support for import contacts to local phone storage
This change allow to select the local storage account to add/import contacts when others cloud/corporate accounts exists. If one or more account exists just ask the user to select the destination account Depends on https://review.lineageos.org/#/c/154855/ Change-Id: Ic055bdb09d037c2f2cdff06cd9a0159df87e2896 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r--src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
index 78b0a3b58..b44629115 100644
--- a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
@@ -88,9 +88,9 @@ public class ContactEditorAccountsChangedActivity extends Activity {
}
final View view;
- if (numAccounts >= 2) {
- // When the user has 2+ writable accounts, show a list of accounts so the user can pick
- // which account to create a contact in.
+ if (numAccounts > 0) {
+ // When the user has writable accounts, show a list of accounts so the user can pick
+ // which account to create a contact in (add also the phone-local storage account).
view = View.inflate(this,
R.layout.contact_editor_accounts_changed_activity_with_picker, null);
@@ -106,34 +106,6 @@ public class ContactEditorAccountsChangedActivity extends Activity {
AccountListFilter.ACCOUNTS_CONTACT_WRITABLE);
accountListView.setAdapter(mAccountListAdapter);
accountListView.setOnItemClickListener(mAccountListItemClickListener);
- } else if (numAccounts == 1) {
- // If the user has 1 writable account we will just show the user a message with 2
- // possible action buttons.
- view = View.inflate(this,
- R.layout.contact_editor_accounts_changed_activity_with_text, null);
-
- final TextView textView = (TextView) view.findViewById(R.id.text);
- final Button leftButton = (Button) view.findViewById(R.id.left_button);
- final Button rightButton = (Button) view.findViewById(R.id.right_button);
-
- final AccountWithDataSet account = accounts.get(0);
- textView.setText(getString(R.string.contact_editor_prompt_one_account,
- account.name));
-
- // This button allows the user to add a new account to the device and return to
- // this app afterwards.
- leftButton.setText(getString(R.string.add_new_account));
- leftButton.setOnClickListener(mAddAccountClickListener);
-
- // This button allows the user to continue creating the contact in the specified
- // account.
- rightButton.setText(getString(android.R.string.ok));
- rightButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- saveAccountAndReturnResult(account);
- }
- });
} else {
// If the user has 0 writable accounts, we will just show the user a message with 2
// possible action buttons.