Merge "Fix NPE in getPhoneType/getEmailType" into ub-contactsdialer-a-dev
diff --git a/src/com/android/contacts/common/list/OnPhoneNumberPickerActionListener.java b/src/com/android/contacts/common/list/OnPhoneNumberPickerActionListener.java
index 138a1dc..819736b 100644
--- a/src/com/android/contacts/common/list/OnPhoneNumberPickerActionListener.java
+++ b/src/com/android/contacts/common/list/OnPhoneNumberPickerActionListener.java
@@ -26,14 +26,15 @@
public static final int CALL_INITIATION_UNKNOWN = 0;
/**
- * Returns the selected phone number to the requester.
+ * Returns the selected phone number uri to the requester.
*/
- void onPickPhoneNumberAction(Uri dataUri, int callInitiationType);
+ void onPickDataUri(Uri dataUri, int callInitiationType);
/**
- * Calls the specified phone number, either as an audio or video call.
+ * Returns the specified phone number to the requester.
+ * May call the specified phone number, either as an audio or video call.
*/
- void onCallNumberDirectly(String phoneNumber, boolean isVideoCall, int callInitiationType);
+ void onPickPhoneNumber(String phoneNumber, boolean isVideoCall, int callInitiationType);
/**
* Returns the selected number as a shortcut intent.
diff --git a/src/com/android/contacts/common/list/PhoneNumberPickerFragment.java b/src/com/android/contacts/common/list/PhoneNumberPickerFragment.java
index 43f7ade..3788a97 100644
--- a/src/com/android/contacts/common/list/PhoneNumberPickerFragment.java
+++ b/src/com/android/contacts/common/list/PhoneNumberPickerFragment.java
@@ -33,7 +33,6 @@
import com.android.contacts.common.util.AccountFilterUtil;
import com.android.contacts.commonbind.analytics.AnalyticsUtil;
-import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -196,7 +195,7 @@
final String number = getPhoneNumber(position);
if (!TextUtils.isEmpty(number)) {
cacheContactInfo(position);
- mListener.onCallNumberDirectly(number, false /* isVideoCall */,
+ mListener.onPickPhoneNumber(number, false /* isVideoCall */,
getCallInitiationType(true /* isRemoteDirectory */));
} else {
Log.w(TAG, "Item at " + position + " was clicked before"
@@ -287,7 +286,7 @@
public void pickPhoneNumber(Uri uri) {
if (mShortcutAction == null) {
- mListener.onPickPhoneNumberAction(uri,
+ mListener.onPickDataUri(uri,
getCallInitiationType(false /* isRemoteDirectory */));
} else {
startPhoneNumberShortcutIntent(uri);
@@ -306,7 +305,7 @@
@Override
public void onPickerResult(Intent data) {
- mListener.onPickPhoneNumberAction(data.getData(),
+ mListener.onPickDataUri(data.getData(),
getCallInitiationType(false /* isRemoteDirectory */));
}