From fe7e9e1d5a083bfe376df0d54bcf632f60012dcf Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Tue, 17 Oct 2017 15:54:45 -0700 Subject: Contacts are now searchable by company name. This change coalesces Cp2 contacts into a new cursor so that they can be associated with the Company name. The following logs can help explain how the data is organizes in the original cursor: display Name (A Pixel), lookupKey (3535i7a9673fc89b77de3), mimeType (vnd.android.cursor.item/name), data1 (A Pixel) display Name (A Pixel), lookupKey (3535i7a9673fc89b77de3), mimeType (vnd.android.cursor.item/note), data1 () display Name (A Pixel), lookupKey (3535i7a9673fc89b77de3), mimeType (vnd.android.cursor.item/group_membership), data1 (1) display Name (A Pixel), lookupKey (3535i7a9673fc89b77de3), mimeType (vnd.android.cursor.item/phone_v2), data1 (+1 650-200-7932) display Name (A Pixel), lookupKey (3535i7a9673fc89b77de3), mimeType (vnd.android.cursor.item/phone_v2), data1 (+1 540-555-6666) display Name (A Pixel), lookupKey (3535i7a9673fc89b77de3), mimeType (vnd.android.cursor.item/organization), data1 (Walmart) This is an example of what is returned for a single contact. We can easily associate contact rows together using the lookup key and determine which rows have relevant data by checking the mime type. I use the data here to coalesce the contacts together into one row for easy parsing in ContactFilterCursor. Rows with mime type phone_v2 contain contact information (for example, this contact has 2 phone numbers). Rows with mime type organization contain contact's company information (for example, this contact works at Walmart). Bug: 67675742,64894607,67848713 Test: existing + SCCT.filter_companyName PiperOrigin-RevId: 172528797 Change-Id: I5c9f66ff0c27276869295eff97bb0216f92995be --- .../dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java') diff --git a/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java b/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java index c8bb36a73..0d52c108e 100644 --- a/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java +++ b/java/com/android/dialer/searchfragment/nearbyplaces/NearbyPlacesCursorLoader.java @@ -41,7 +41,7 @@ public final class NearbyPlacesCursorLoader extends CursorLoader { */ public NearbyPlacesCursorLoader( Context context, String query, @NonNull List directoryIds) { - super(context, getContentUri(context, query), Projections.PHONE_PROJECTION, null, null, null); + super(context, getContentUri(context, query), Projections.DATA_PROJECTION, null, null, null); this.directoryId = getDirectoryId(directoryIds); } -- cgit v1.2.3