From cd274d9e5dc7d3f38c9ca216b134bc7501358422 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 7 Apr 2020 12:24:23 -0700 Subject: [PATCH] Always use the largeIcon as avatar replacement A few apps were targeting >P but not providing avatars yet. Even though this was an app bug it lead to some weirdness in our UI. We therefore always do the workaround of using the largeicon for an avatar instead of generating one if we're in a OneToOne conversation. Bug: 153466270 Test: post hangouts message, observe normal person avatar Change-Id: Ia5262ca7dfc20d265c2d0532e88932c878f38552 --- core/java/android/app/Notification.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 7a593498e9671..babeffc120bb3 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -7589,10 +7589,8 @@ public class Notification implements Parcelable >= Build.VERSION_CODES.P; boolean isOneToOne; CharSequence nameReplacement = null; - Icon avatarReplacement = null; if (!atLeastP) { isOneToOne = TextUtils.isEmpty(conversationTitle); - avatarReplacement = mBuilder.mN.mLargeIcon; if (hasOnlyWhiteSpaceSenders()) { isOneToOne = true; nameReplacement = conversationTitle; @@ -7641,7 +7639,7 @@ public class Notification implements Parcelable contentView.setBoolean(R.id.status_bar_latest_event_content, "setIsCollapsed", isCollapsed); contentView.setIcon(R.id.status_bar_latest_event_content, "setAvatarReplacement", - avatarReplacement); + mBuilder.mN.mLargeIcon); contentView.setCharSequence(R.id.status_bar_latest_event_content, "setNameReplacement", nameReplacement); contentView.setBoolean(R.id.status_bar_latest_event_content, "setIsOneToOne",