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/incallui/ConferenceParticipantListAdapter.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/incallui/ConferenceParticipantListAdapter.java')
-rw-r--r-- | java/com/android/incallui/ConferenceParticipantListAdapter.java | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/java/com/android/incallui/ConferenceParticipantListAdapter.java b/java/com/android/incallui/ConferenceParticipantListAdapter.java index c71bf59b2..d13bd3d5a 100644 --- a/java/com/android/incallui/ConferenceParticipantListAdapter.java +++ b/java/com/android/incallui/ConferenceParticipantListAdapter.java @@ -18,7 +18,6 @@ package com.android.incallui; import android.content.Context; import android.net.Uri; -import android.support.annotation.Nullable; import android.support.v4.util.ArrayMap; import android.telephony.PhoneNumberUtils; import android.text.BidiFormatter; @@ -33,11 +32,10 @@ import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; -import com.android.contacts.common.preference.ContactsPreferences; -import com.android.contacts.common.util.ContactDisplayUtils; import com.android.dialer.common.LogUtil; import com.android.dialer.contactphoto.ContactPhotoManager; import com.android.dialer.contactphoto.ContactPhotoManager.DefaultImageRequest; +import com.android.dialer.contacts.ContactsComponent; import com.android.incallui.ContactInfoCache.ContactCacheEntry; import com.android.incallui.call.CallList; import com.android.incallui.call.DialerCall; @@ -59,8 +57,6 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { private final ListView listView; /** Hashmap to make accessing participant info by call Id faster. */ private final Map<String, ParticipantInfo> participantsByCallId = new ArrayMap<>(); - /** ContactsPreferences used to lookup displayName preferences */ - @Nullable private final ContactsPreferences contactsPreferences; /** Contact photo manager to retrieve cached contact photo information. */ private final ContactPhotoManager contactPhotoManager; /** Listener used to handle tap of the "disconnect' button for a participant. */ @@ -103,7 +99,6 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { ListView listView, ContactPhotoManager contactPhotoManager) { this.listView = listView; - contactsPreferences = ContactsPreferencesFactory.newContactsPreferences(getContext()); this.contactPhotoManager = contactPhotoManager; } @@ -116,10 +111,6 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { */ public void updateParticipants( List<DialerCall> conferenceParticipants, boolean parentCanSeparate) { - if (contactsPreferences != null) { - contactsPreferences.refreshValue(ContactsPreferences.DISPLAY_ORDER_KEY); - contactsPreferences.refreshValue(ContactsPreferences.SORT_ORDER_KEY); - } this.parentCanSeparate = parentCanSeparate; updateParticipantInfo(conferenceParticipants); } @@ -235,8 +226,9 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { call.can(android.telecom.Call.Details.CAPABILITY_DISCONNECT_FROM_CONFERENCE); String name = - ContactDisplayUtils.getPreferredDisplayName( - contactCache.namePrimary, contactCache.nameAlternative, contactsPreferences); + ContactsComponent.get(getContext()) + .contactDisplayPreferences() + .getDisplayName(contactCache.namePrimary, contactCache.nameAlternative); setCallerInfoForRow( result, @@ -441,14 +433,16 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { // Contact names might be null, so replace with empty string. ContactCacheEntry c1 = p1.getContactCacheEntry(); String p1Name = - ContactDisplayUtils.getPreferredSortName( - c1.namePrimary, c1.nameAlternative, contactsPreferences); + ContactsComponent.get(getContext()) + .contactDisplayPreferences() + .getSortName(c1.namePrimary, c1.nameAlternative); p1Name = p1Name != null ? p1Name : ""; ContactCacheEntry c2 = p2.getContactCacheEntry(); String p2Name = - ContactDisplayUtils.getPreferredSortName( - c2.namePrimary, c2.nameAlternative, contactsPreferences); + ContactsComponent.get(getContext()) + .contactDisplayPreferences() + .getSortName(c2.namePrimary, c2.nameAlternative); p2Name = p2Name != null ? p2Name : ""; return p1Name.compareToIgnoreCase(p2Name); |