diff options
author | 2025-02-21 10:19:25 -0800 | |
---|---|---|
committer | 2025-02-21 10:19:25 -0800 | |
commit | 2b309c889f5b4130e81193e439ccab37feb716de (patch) | |
tree | f57119701f1321daa10e1b5206d17ce352c0907f | |
parent | b3bd93dac4b1a7a86de10533072f29eea0d8275c (diff) |
[Notif redesign] Include imageMessageContainer in animation
A redesign change accidentally excluded the imageMessageContainer from the list of drawables used in the conversation animation. While it's true that it's now nullable where previously it was not (since it doesn't exist in the collapsed layout), we should still include it when not null.
Change-Id: Ia0e780f8de71e7dea6921bc3a9dcfa99e8fa9cb6
Fix: 397900637
Flag: android.app.notifications_redesign_templates
Test: NotificationConversationTemplateViewWrapperTest
2 files changed, 8 insertions, 6 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt index 081f52c4ff3b..bf6ee9253418 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt @@ -75,9 +75,10 @@ class NotificationConversationTemplateViewWrapperTest : SysuiTestCase() { // Creates a mocked out NotificationEntry of ConversationLayout type, // with a mock imageMessage.drawable embedded in its MessagingImageMessages // (both top level, and in a group). - val mockDrawable = mock<AnimatedImageDrawable>() - val mockDrawable2 = mock<AnimatedImageDrawable>() - val mockLayoutView: View = fakeConversationLayout(mockDrawable, mockDrawable2) + val mockDrawableGroupMessage = mock<AnimatedImageDrawable>() + val mockDrawableImageMessage = mock<AnimatedImageDrawable>() + val mockLayoutView: View = + fakeConversationLayout(mockDrawableGroupMessage, mockDrawableImageMessage) val wrapper: NotificationViewWrapper = NotificationConversationTemplateViewWrapper(mContext, mockLayoutView, mRow) @@ -85,8 +86,8 @@ class NotificationConversationTemplateViewWrapperTest : SysuiTestCase() { wrapper.setAnimationsRunning(false) // Verifies that each AnimatedImageDrawable is started animating. - verify(mockDrawable).stop() - verify(mockDrawable2).stop() + verify(mockDrawableGroupMessage).stop() + verify(mockDrawableImageMessage).stop() } private fun fakeConversationLayout( diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt index 6a96fba8f28d..3d5f9e4cafdd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt @@ -174,7 +174,8 @@ class NotificationConversationTemplateViewWrapper( // and the top level image message container. val containers = messageContainers.asSequence().map { it.messageContainer } + - if (notificationsRedesignTemplates()) emptySequence() + if (notificationsRedesignTemplates() && imageMessageContainer == null) + emptySequence() else sequenceOf(imageMessageContainer!!) val drawables = containers |