diff options
author | twyen <twyen@google.com> | 2018-06-26 16:04:53 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-06-26 16:04:53 -0700 |
commit | bfd105673cd6eb21a1c207d24169ad9bfe645539 (patch) | |
tree | 198fcf37848a75c8d68f74679a56fd9dc0f4891b /java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java | |
parent | ee0371753257a3db0cce37f5dffae7ac6ebf34b2 (diff) | |
parent | f9d508090cbf3b9f85b72241c77f625c152448bc (diff) |
Merge changes I45374e61,I265dcc61,Id4622886,I09d0df69,I3ea0fb46 am: 2f6900466e am: e6262b0bce
am: f9d508090c
Change-Id: I329713a5083f5ccd632b536e41f466eaef9dc4e2
Diffstat (limited to 'java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java')
-rw-r--r-- | java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java index 7caa314f3..f4ed21ee4 100644 --- a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java @@ -27,8 +27,10 @@ import android.provider.ContactsContract.Directory; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.text.TextUtils; -import com.android.contacts.common.preference.ContactsPreferences; import com.android.dialer.common.LogUtil; +import com.android.dialer.contacts.ContactsComponent; +import com.android.dialer.contacts.displaypreference.ContactDisplayPreferences.DisplayOrder; +import com.android.dialer.contacts.displaypreference.ContactDisplayPreferences.SortOrder; import com.android.dialer.searchfragment.common.Projections; import com.android.dialer.searchfragment.common.SearchCursor; import com.android.dialer.smartdial.SmartDialCursorLoader; @@ -55,9 +57,9 @@ public final class SearchContactsCursorLoader extends CursorLoader { } private static String[] getProjection(Context context) { - ContactsPreferences contactsPrefs = new ContactsPreferences(context); boolean displayOrderPrimary = - (contactsPrefs.getDisplayOrder() == ContactsPreferences.DISPLAY_ORDER_PRIMARY); + (ContactsComponent.get(context).contactDisplayPreferences().getDisplayOrder() + == DisplayOrder.PRIMARY); return displayOrderPrimary ? Projections.CP2_PROJECTION : Projections.CP2_PROJECTION_ALTERNATIVE; @@ -70,9 +72,9 @@ public final class SearchContactsCursorLoader extends CursorLoader { } private static String getSortKey(Context context) { - ContactsPreferences contactsPrefs = new ContactsPreferences(context); boolean sortOrderPrimary = - (contactsPrefs.getSortOrder() == ContactsPreferences.SORT_ORDER_PRIMARY); + (ContactsComponent.get(context).contactDisplayPreferences().getSortOrder() + == SortOrder.BY_PRIMARY); return sortOrderPrimary ? Phone.SORT_KEY_PRIMARY : Phone.SORT_KEY_ALTERNATIVE; } |