summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/searchfragment/remote/RemoteContactViewHolder.java
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2017-08-31 02:01:35 -0700
committerEric Erfanian <erfanian@google.com>2017-09-06 16:42:02 -0700
commitdede7e703541f81af4533ce4a53f18f327090568 (patch)
treee85d530eef4e2ffe4b450ff937c188832ed22d72 /java/com/android/dialer/searchfragment/remote/RemoteContactViewHolder.java
parent6627396c33440abd1bd32daa617aa4848be167e1 (diff)
NewSearchFragment contact photos now properly open quick contact cards.
There was an issue where businesses' and remote contacts' contact photos wouldn't open contact cards correctly. The issue was rooted in the incorrect contact uri being assigned to the quick contact badge. from the bugbash: 16. Tap on business icon from search results says “ no application found” instead of opening the business info 17. Same as #16 but with contact from Directory Google.com - “The contact doesn’t exist” when tapping contact icon Bug: 64902476 Test: existing PiperOrigin-RevId: 167111016 Change-Id: I4b6f7ca812d2fc4dc220951e8c05db2c8b8d6114
Diffstat (limited to 'java/com/android/dialer/searchfragment/remote/RemoteContactViewHolder.java')
-rw-r--r--java/com/android/dialer/searchfragment/remote/RemoteContactViewHolder.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/java/com/android/dialer/searchfragment/remote/RemoteContactViewHolder.java b/java/com/android/dialer/searchfragment/remote/RemoteContactViewHolder.java
index 5fb12d349..df3eacc5b 100644
--- a/java/com/android/dialer/searchfragment/remote/RemoteContactViewHolder.java
+++ b/java/com/android/dialer/searchfragment/remote/RemoteContactViewHolder.java
@@ -22,6 +22,7 @@ import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds.Phone;
+import android.provider.ContactsContract.Contacts;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
@@ -119,10 +120,14 @@ public final class RemoteContactViewHolder extends RecyclerView.ViewHolder
return (String) Phone.getTypeLabel(resources, numberType, numberLabel);
}
- private static Uri getContactUri(Cursor cursor) {
+ private static Uri getContactUri(SearchCursor cursor) {
long contactId = cursor.getLong(Projections.PHONE_ID);
String lookupKey = cursor.getString(Projections.PHONE_LOOKUP_KEY);
- return ContactsContract.Contacts.getLookupUri(contactId, lookupKey);
+ return Contacts.getLookupUri(contactId, lookupKey)
+ .buildUpon()
+ .appendQueryParameter(
+ ContactsContract.DIRECTORY_PARAM_KEY, String.valueOf(cursor.getDirectoryId()))
+ .build();
}
@Override