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/ExternalCallNotifier.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/ExternalCallNotifier.java')
-rw-r--r-- | java/com/android/incallui/ExternalCallNotifier.java | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/java/com/android/incallui/ExternalCallNotifier.java b/java/com/android/incallui/ExternalCallNotifier.java index 10c4a6490..160e2502f 100644 --- a/java/com/android/incallui/ExternalCallNotifier.java +++ b/java/com/android/incallui/ExternalCallNotifier.java @@ -38,10 +38,9 @@ import android.text.TextUtils; import android.util.ArrayMap; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.compat.CallCompat; -import com.android.contacts.common.preference.ContactsPreferences; -import com.android.contacts.common.util.ContactDisplayUtils; import com.android.dialer.common.Assert; import com.android.dialer.contactphoto.BitmapUtil; +import com.android.dialer.contacts.ContactsComponent; import com.android.dialer.notification.DialerNotificationManager; import com.android.dialer.notification.NotificationChannelId; import com.android.dialer.telecom.TelecomCallUtil; @@ -78,13 +77,11 @@ public class ExternalCallNotifier implements ExternalCallList.ExternalCallListen private final ContactInfoCache contactInfoCache; private Map<Call, NotificationInfo> notifications = new ArrayMap<>(); private int nextUniqueNotificationId; - private ContactsPreferences contactsPreferences; /** Initializes a new instance of the external call notifier. */ public ExternalCallNotifier( @NonNull Context context, @NonNull ContactInfoCache contactInfoCache) { this.context = context; - contactsPreferences = ContactsPreferencesFactory.newContactsPreferences(this.context); this.contactInfoCache = contactInfoCache; } @@ -216,7 +213,7 @@ public class ExternalCallNotifier implements ExternalCallList.ExternalCallListen * notification to the notification manager. */ private void saveContactInfo(NotificationInfo info, ContactInfoCache.ContactCacheEntry entry) { - info.setContentTitle(getContentTitle(context, contactsPreferences, entry, info.getCall())); + info.setContentTitle(getContentTitle(context, entry, info.getCall())); info.setPersonReference(getPersonReference(entry, info.getCall())); postNotification(info); } @@ -342,17 +339,12 @@ public class ExternalCallNotifier implements ExternalCallList.ExternalCallListen * number. * * @param context The context. - * @param contactsPreferences Contacts preferences, used to determine the preferred formatting for - * contact names. * @param contactInfo The contact info which was looked up in the contact cache. * @param call The call to generate a title for. * @return The content title. */ private @Nullable String getContentTitle( - Context context, - @Nullable ContactsPreferences contactsPreferences, - ContactInfoCache.ContactCacheEntry contactInfo, - android.telecom.Call call) { + Context context, ContactInfoCache.ContactCacheEntry contactInfo, android.telecom.Call call) { if (call.getDetails().hasProperty(android.telecom.Call.Details.PROPERTY_CONFERENCE)) { return CallerInfoUtils.getConferenceString( @@ -361,8 +353,9 @@ public class ExternalCallNotifier implements ExternalCallList.ExternalCallListen } String preferredName = - ContactDisplayUtils.getPreferredDisplayName( - contactInfo.namePrimary, contactInfo.nameAlternative, contactsPreferences); + ContactsComponent.get(context) + .contactDisplayPreferences() + .getDisplayName(contactInfo.namePrimary, contactInfo.nameAlternative); if (TextUtils.isEmpty(preferredName)) { return TextUtils.isEmpty(contactInfo.number) ? null |