From cd274d9e5dc7d3f38c9ca216b134bc7501358422 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 7 Apr 2020 12:24:23 -0700 Subject: [PATCH 1/2] 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", From 792eb06ff0e1c88f3abce738c39d79e65c0dddcb Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 8 Apr 2020 12:36:43 -0700 Subject: [PATCH 2/2] Fixed the transformation of min priority notifications The headertext wasn't animating to the title anymore because the order of the low-priority call has changed in a refactor We're now looking at the datasource directly instead of looking at the row state avoiding the ordering issue Fixes: 151253867 Test: add min priority notification, observe header transforms to title Change-Id: I7dc8f5fdef4f1f449064e66bcc63a85f7e69a185 --- .../notification/row/wrapper/NotificationHeaderViewWrapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java index 0c311b403c489..13d7a9b47c2f8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java @@ -161,7 +161,7 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper { @Override public void onContentUpdated(ExpandableNotificationRow row) { super.onContentUpdated(row); - mIsLowPriority = row.isLowPriority(); + mIsLowPriority = row.getEntry().isAmbient(); mTransformLowPriorityTitle = !row.isChildInGroup() && !row.isSummaryWithChildren(); ArraySet previousViews = mTransformationHelper.getAllTransformingViews();