summaryrefslogtreecommitdiffstats
path: root/src/com/android/dialer/DialtactsActivity.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-12-05 14:19:00 -0800
committerTyler Gunn <tgunn@google.com>2014-12-05 14:19:00 -0800
commit1513fec51cbb557685f1976ee2050c73ccdbe036 (patch)
tree57b765a741eac25a2aae76ddcde0c7fe11262eb2 /src/com/android/dialer/DialtactsActivity.java
parent32cc8c02aec4859c678c931d719e86b2566ba774 (diff)
downloadandroid_packages_apps_Dialer-1513fec51cbb557685f1976ee2050c73ccdbe036.tar.gz
android_packages_apps_Dialer-1513fec51cbb557685f1976ee2050c73ccdbe036.tar.bz2
android_packages_apps_Dialer-1513fec51cbb557685f1976ee2050c73ccdbe036.zip
Updating "Add Contact" to pre-populate full contact info.
1. For recent call entries with a name and phone number, the name will now also be added. 2. For recent call entries which have complete address information provided by nearby places, all information except the contact photo will be added. The contact photo is excluded, as the ContactsLoader would attempt to load the contact photo while parsing the contact information. On a slow connection this could cause a noticeable pause while adding the contact. Bug: 17308163 Change-Id: If2e78bd1257096b344ff2dd266dcdbaeed4f1471
Diffstat (limited to 'src/com/android/dialer/DialtactsActivity.java')
-rw-r--r--src/com/android/dialer/DialtactsActivity.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 5e6f03597..95b72157e 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -1050,8 +1050,22 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
}
public static Intent getAddNumberToContactIntent(CharSequence text) {
- final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
- intent.putExtra(Intents.Insert.PHONE, text);
+ return getAddToContactIntent(null /* name */, text /* phoneNumber */,
+ -1 /* phoneNumberType */);
+ }
+
+ public static Intent getAddToContactIntent(CharSequence name, CharSequence phoneNumber,
+ int phoneNumberType) {
+ Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
+ intent.putExtra(Intents.Insert.PHONE, phoneNumber);
+ // Only include the name and phone type extras if they are specified (the method
+ // getAddNumberToContactIntent does not use them).
+ if (name != null) {
+ intent.putExtra(Intents.Insert.NAME, name);
+ }
+ if (phoneNumberType != -1) {
+ intent.putExtra(Intents.Insert.PHONE_TYPE, phoneNumberType);
+ }
intent.setType(Contacts.CONTENT_ITEM_TYPE);
return intent;
}