diff options
author | calderwoodra <calderwoodra@google.com> | 2017-10-18 04:49:12 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-18 04:49:12 +0000 |
commit | df419c43b14e58e5241867e3bd2962a7b555f74f (patch) | |
tree | 7606a99d60659b38dbc4895e1826afac70e550de /java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java | |
parent | 7f1dd720b96504ce706e4d7d8867211048bf5cfa (diff) | |
parent | 4b46ec2258373c76c44c900a3cfe93c1d28935a8 (diff) |
Merge changes Ib92b055d,I5c9f66ff
am: 4b46ec2258
Change-Id: I8cbfb88558d46cbdd3ed696b56774913d1839a78
Diffstat (limited to 'java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java')
-rw-r--r-- | java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java index b7fc9b5c5..f1230c6d9 100644 --- a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java @@ -19,7 +19,10 @@ package com.android.dialer.searchfragment.cp2; import android.content.Context; import android.content.CursorLoader; import android.database.Cursor; +import android.provider.ContactsContract.CommonDataKinds.Nickname; +import android.provider.ContactsContract.CommonDataKinds.Organization; import android.provider.ContactsContract.CommonDataKinds.Phone; +import android.provider.ContactsContract.Data; import android.support.annotation.Nullable; import com.android.dialer.searchfragment.common.Projections; @@ -32,14 +35,27 @@ public final class SearchContactsCursorLoader extends CursorLoader { public SearchContactsCursorLoader(Context context, @Nullable String query) { super( context, - Phone.CONTENT_URI, - Projections.PHONE_PROJECTION, - null, + Data.CONTENT_URI, + Projections.DATA_PROJECTION, + whereStatement(), null, Phone.SORT_KEY_PRIMARY + " ASC"); this.query = query; } + private static String whereStatement() { + return (Phone.NUMBER + " IS NOT NULL") + + " AND " + + Data.MIMETYPE + + " IN (\'" + + Phone.CONTENT_ITEM_TYPE + + "\', \'" + + Nickname.CONTENT_ITEM_TYPE + + "\', \'" + + Organization.CONTENT_ITEM_TYPE + + "\')"; + } + @Override public Cursor loadInBackground() { // All contacts |