summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2014-02-09 03:25:06 +0100
committerRohit Yengisetty <rohit@cyngn.com>2015-12-01 16:57:08 -0800
commitc61ce7797f196ab452f75cfb38ecd7ecbe942526 (patch)
tree0b1849a801a351960484a6033821433ebbf7658d
parent5b45a0b05511a2d21fe0c7b416c6233472064937 (diff)
downloadandroid_packages_apps_Contacts-c61ce7797f196ab452f75cfb38ecd7ecbe942526.tar.gz
android_packages_apps_Contacts-c61ce7797f196ab452f75cfb38ecd7ecbe942526.tar.bz2
android_packages_apps_Contacts-c61ce7797f196ab452f75cfb38ecd7ecbe942526.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: http://review.cyanogenmod.org/#/c/59353/ Change-Id: Ic055bdb09d037c2f2cdff06cd9a0159df87e2896 JIRA: CYAN-391 Issue: https://jira.cyanogenmod.org/browse/CYAN-391 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r--src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java33
1 files changed, 3 insertions, 30 deletions
diff --git a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
index a922ca128..500d7c177 100644
--- a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
@@ -84,9 +84,9 @@ public class ContactEditorAccountsChangedActivity extends Activity {
throw new IllegalStateException("Cannot have a negative number of accounts");
}
- 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).
setContentView(R.layout.contact_editor_accounts_changed_activity_with_picker);
final TextView textView = (TextView) findViewById(R.id.text);
@@ -101,33 +101,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.
- setContentView(R.layout.contact_editor_accounts_changed_activity_with_text);
-
- final TextView textView = (TextView) findViewById(R.id.text);
- final Button leftButton = (Button) findViewById(R.id.left_button);
- final Button rightButton = (Button) 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.