From 938468da6f5c225ebb161a68bd949c9cf3261892 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 24 Oct 2017 14:05:52 -0700 Subject: Rename the new bubble package name from "bubble" to "newbubble". It fixes AOSP for package name conflict. Test: manual PiperOrigin-RevId: 173298696 Change-Id: Id10ebe0bcf029e61f65cf6580c7198abd8395081 --- .../dialer/searchfragment/cp2/ContactFilterCursor.java | 16 ++++++++-------- .../android/dialer/searchfragment/cp2/Cp2Contact.java | 2 +- .../searchfragment/cp2/SearchContactsCursorLoader.java | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'java/com/android/dialer/searchfragment/cp2') diff --git a/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java b/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java index 9a0ca0088..84c22a2cf 100644 --- a/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java +++ b/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java @@ -31,7 +31,6 @@ import android.support.annotation.IntDef; import android.support.annotation.Nullable; import android.support.v4.util.ArraySet; import android.text.TextUtils; -import com.android.dialer.common.Assert; import com.android.dialer.searchfragment.common.Projections; import com.android.dialer.searchfragment.common.QueryFilteringUtil; import java.lang.annotation.Retention; @@ -71,7 +70,7 @@ final class ContactFilterCursor implements Cursor { } /** - * @param cursor with projection {@link Projections#DATA_PROJECTION}. + * @param cursor with projection {@link Projections#CP2_PROJECTION}. * @param query to filter cursor results. */ ContactFilterCursor(Cursor cursor, @Nullable String query) { @@ -123,8 +122,7 @@ final class ContactFilterCursor implements Cursor { // Sort by display name, then build new cursor from coalesced contacts. // We sort the contacts so that they are displayed to the user in lexicographic order. Collections.sort(coalescedContacts, (o1, o2) -> o1.displayName().compareTo(o2.displayName())); - MatrixCursor newCursor = - new MatrixCursor(Projections.DATA_PROJECTION, coalescedContacts.size()); + MatrixCursor newCursor = new MatrixCursor(Projections.CP2_PROJECTION, coalescedContacts.size()); for (Cp2Contact contact : coalescedContacts) { newCursor.addRow(contact.toCursorRow()); } @@ -139,11 +137,13 @@ final class ContactFilterCursor implements Cursor { if (contact.mimeType().equals(Phone.CONTENT_ITEM_TYPE)) { phoneContacts.add(contact); } else if (contact.mimeType().equals(Organization.CONTENT_ITEM_TYPE)) { - Assert.checkArgument(TextUtils.isEmpty(companyName)); - companyName = contact.companyName(); + // Since a contact can have more than one company name but they aren't visible to the user + // in our search UI, we can lazily concatenate them together to make them all searchable. + companyName += " " + contact.companyName(); } else if (contact.mimeType().equals(Nickname.CONTENT_ITEM_TYPE)) { - Assert.checkArgument(TextUtils.isEmpty(nickName)); - nickName = contact.nickName(); + // Since a contact can have more than one nickname but they aren't visible to the user + // in our search UI, we can lazily concatenate them together to make them all searchable. + nickName += " " + contact.nickName(); } } diff --git a/java/com/android/dialer/searchfragment/cp2/Cp2Contact.java b/java/com/android/dialer/searchfragment/cp2/Cp2Contact.java index f199f679b..8e5e3e781 100644 --- a/java/com/android/dialer/searchfragment/cp2/Cp2Contact.java +++ b/java/com/android/dialer/searchfragment/cp2/Cp2Contact.java @@ -111,7 +111,7 @@ public abstract class Cp2Contact { } public Object[] toCursorRow() { - Object[] row = new Object[Projections.DATA_PROJECTION.length]; + Object[] row = new Object[Projections.CP2_PROJECTION.length]; row[Projections.ID] = phoneId(); row[Projections.PHONE_TYPE] = phoneType(); row[Projections.PHONE_LABEL] = phoneLabel(); diff --git a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java index f1230c6d9..d3abbffca 100644 --- a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java @@ -36,7 +36,7 @@ public final class SearchContactsCursorLoader extends CursorLoader { super( context, Data.CONTENT_URI, - Projections.DATA_PROJECTION, + Projections.CP2_PROJECTION, whereStatement(), null, Phone.SORT_KEY_PRIMARY + " ASC"); -- cgit v1.2.3