From 8e4787e7b3d981d45ff6621a5b49f632b27823f9 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 4 Sep 2015 13:57:46 -0700 Subject: Use Dialer utility for getting LookupUri. The intention is to consolidate how InCall and Dialer do Contact lookups, but it's actually hard to do this truly without more refactoring because they have different model and query numbers. Just get the same URI for the initial lookup now... specific casing, such as in the secondary lookups if the initial SIP query fails, is still implemented separately in ContactInfoHelper and CallerInfo#doSecondaryLookupIfNecessary. Bug: 19993243 Change-Id: I8c5fd75d3cda84607d5ee5858b2b73adf20eebb8 --- InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java b/InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java index 046b77745..ec2296f86 100644 --- a/InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java +++ b/InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java @@ -29,6 +29,7 @@ import android.provider.ContactsContract.PhoneLookup; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; +import com.android.dialer.calllog.ContactInfoHelper; import com.android.contacts.common.util.PhoneNumberHelper; import com.android.contacts.common.util.TelephonyManagerUtils; @@ -343,11 +344,7 @@ public class CallerInfoAsyncQuery { // Construct the URI object and query params, and start the query. - final Uri contactRef = PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI.buildUpon() - .appendPath(info.phoneNumber) - .appendQueryParameter(PhoneLookup.QUERY_PARAMETER_SIP_ADDRESS, - String.valueOf(PhoneNumberHelper.isUriNumber(info.phoneNumber))) - .build(); + final Uri contactRef = ContactInfoHelper.getContactInfoLookupUri(info.phoneNumber); if (DBG) { Log.d(LOG_TAG, "==> contactRef: " + sanitizeUriToString(contactRef)); -- cgit v1.2.3