Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt +6 −5 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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( Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt +2 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt +6 −5 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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( Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt +2 −1 Original line number Diff line number Diff line Loading @@ -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 Loading