Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinator.kt +4 −7 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.content.Context import com.android.systemui.res.R import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.statusbar.notification.AssistantFeedbackController import com.android.systemui.statusbar.notification.collection.NotifCollection import com.android.systemui.statusbar.notification.collection.NotifPipeline import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.collection.PipelineEntry Loading @@ -40,7 +39,6 @@ internal constructor( @ShadeDisplayAware context: Context, private var mAssistantFeedbackController: AssistantFeedbackController, private var mSectionStyleProvider: SectionStyleProvider, private val notifCollection: NotifCollection, ) : Coordinator { private var entryToExpand: NotificationEntry? = null Loading Loading @@ -76,14 +74,13 @@ internal constructor( } private fun onAfterRenderEntry(entry: NotificationEntry, controller: NotifRowController) { val isBundledSingleton = entry.isBundled && (!entry.sbn.isGroup || notifCollection.isOnlyChildInGroup(entry)) // If mAlwaysExpandNonGroupedNotification is false, then only expand the // very first notification if it's not a child of grouped notifications and when // mAutoExpandFirstNotification is true. controller.setSystemExpanded(isBundledSingleton || (!entry.isBundled && (mAlwaysExpandNonGroupedNotification || (mAutoExpandFirstNotification && entry == entryToExpand))) controller.setSystemExpanded( !entry.isBundled && (mAlwaysExpandNonGroupedNotification || (mAutoExpandFirstNotification && entry == entryToExpand)) ) // Show/hide the feedback icon controller.setFeedbackIcon(mAssistantFeedbackController.getFeedbackIcon(entry.ranking)) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +0 −5 Original line number Diff line number Diff line Loading @@ -85,8 +85,6 @@ public class NotificationChildrenContainer extends ViewGroup @VisibleForTesting static final int NUMBER_OF_CHILDREN_WHEN_COLLAPSED = 2; @VisibleForTesting static final int NUMBER_OF_CHILDREN_WHEN_COLLAPSED_BUNDLED = 5; @VisibleForTesting static final int NUMBER_OF_CHILDREN_WHEN_SYSTEM_EXPANDED = 5; public static final int NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED = 8; private static final AnimationProperties ALPHA_FADE_IN = new AnimationProperties() { Loading Loading @@ -1040,9 +1038,6 @@ public class NotificationChildrenContainer extends ViewGroup if (isBundle()) { return NUMBER_OF_CHILDREN_BUNDLE_COLLAPSED; } else { if (getContainingNotification().getEntryAdapter().isBundled()) { return NUMBER_OF_CHILDREN_WHEN_COLLAPSED_BUNDLED; } return NUMBER_OF_CHILDREN_WHEN_COLLAPSED; } } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinatorTest.kt +8 −33 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.notification.collection.coordinator import android.app.NotificationChannel import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper.RunWithLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest Loading @@ -29,10 +28,8 @@ import com.android.systemui.statusbar.notification.collection.buildNotificationE import com.android.systemui.statusbar.notification.collection.listbuilder.NotifSection import com.android.systemui.statusbar.notification.collection.listbuilder.OnAfterRenderEntryListener import com.android.systemui.statusbar.notification.collection.listbuilder.OnBeforeRenderListListener import com.android.systemui.statusbar.notification.collection.notifCollection import com.android.systemui.statusbar.notification.collection.provider.SectionStyleProvider import com.android.systemui.statusbar.notification.collection.render.NotifRowController import com.android.systemui.statusbar.notification.shared.NotificationBundleUi import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq Loading Loading @@ -72,8 +69,8 @@ class RowAppearanceCoordinatorTest : SysuiTestCase() { @Before fun setUp() { initMocks(this) coordinator = RowAppearanceCoordinator( mContext, assistantFeedbackController, sectionStyleProvider, kosmos.notifCollection) coordinator = RowAppearanceCoordinator(mContext, assistantFeedbackController, sectionStyleProvider) coordinator.attach(pipeline) beforeRenderListListener = withArgCaptor { verify(pipeline).addOnBeforeRenderListListener(capture()) Loading @@ -92,7 +89,7 @@ class RowAppearanceCoordinatorTest : SysuiTestCase() { } @Test fun testSetSystemExpandedOnlyOnFirstIfNotBundle() { fun testSetSystemExpandedOnlyOnFirst() { whenever(sectionStyleProvider.isMinimizedSection(eq(section1))).thenReturn(false) whenever(sectionStyleProvider.isMinimizedSection(eq(section1))).thenReturn(false) beforeRenderListListener.onBeforeRenderList(listOf(entry1, entry2)) Loading @@ -114,34 +111,12 @@ class RowAppearanceCoordinatorTest : SysuiTestCase() { } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun testSetSystemExpanded_Bundled_NotInGroup() { whenever(sectionStyleProvider.isMinimizedSection(eq(section3))).thenReturn(false) beforeRenderListListener.onBeforeRenderList(listOf(entry3)) afterRenderEntryListener.onAfterRenderEntry(entry3, controller3) verify(controller3).setSystemExpanded(eq(true)) } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun testSetSystemExpanded_Bundled_SingleNotifInGroup() { entry3.sbn.overrideGroupKey = "bundled" whenever(sectionStyleProvider.isMinimizedSection(eq(section3))).thenReturn(false) whenever(kosmos.notifCollection.isOnlyChildInGroup(entry3)).thenReturn(true) beforeRenderListListener.onBeforeRenderList(listOf(entry3)) afterRenderEntryListener.onAfterRenderEntry(entry3, controller3) verify(controller3).setSystemExpanded(eq(true)) } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun testSetSystemExpanded_Bundled_NotMultiChildGroup() { entry3.sbn.overrideGroupKey = "bundled" fun testSetSystemExpandedNeverIfBundled() { whenever(sectionStyleProvider.isMinimizedSection(eq(section1))).thenReturn(false) whenever(sectionStyleProvider.isMinimizedSection(eq(section3))).thenReturn(false) whenever(kosmos.notifCollection.isOnlyChildInGroup(entry3)).thenReturn(false) beforeRenderListListener.onBeforeRenderList(listOf(entry3)) beforeRenderListListener.onBeforeRenderList(listOf(entry1, entry3)) afterRenderEntryListener.onAfterRenderEntry(entry1, controller1) verify(controller1).setSystemExpanded(eq(true)) afterRenderEntryListener.onAfterRenderEntry(entry3, controller3) verify(controller3).setSystemExpanded(eq(false)) } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinator.kt +4 −7 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.content.Context import com.android.systemui.res.R import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.statusbar.notification.AssistantFeedbackController import com.android.systemui.statusbar.notification.collection.NotifCollection import com.android.systemui.statusbar.notification.collection.NotifPipeline import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.collection.PipelineEntry Loading @@ -40,7 +39,6 @@ internal constructor( @ShadeDisplayAware context: Context, private var mAssistantFeedbackController: AssistantFeedbackController, private var mSectionStyleProvider: SectionStyleProvider, private val notifCollection: NotifCollection, ) : Coordinator { private var entryToExpand: NotificationEntry? = null Loading Loading @@ -76,14 +74,13 @@ internal constructor( } private fun onAfterRenderEntry(entry: NotificationEntry, controller: NotifRowController) { val isBundledSingleton = entry.isBundled && (!entry.sbn.isGroup || notifCollection.isOnlyChildInGroup(entry)) // If mAlwaysExpandNonGroupedNotification is false, then only expand the // very first notification if it's not a child of grouped notifications and when // mAutoExpandFirstNotification is true. controller.setSystemExpanded(isBundledSingleton || (!entry.isBundled && (mAlwaysExpandNonGroupedNotification || (mAutoExpandFirstNotification && entry == entryToExpand))) controller.setSystemExpanded( !entry.isBundled && (mAlwaysExpandNonGroupedNotification || (mAutoExpandFirstNotification && entry == entryToExpand)) ) // Show/hide the feedback icon controller.setFeedbackIcon(mAssistantFeedbackController.getFeedbackIcon(entry.ranking)) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +0 −5 Original line number Diff line number Diff line Loading @@ -85,8 +85,6 @@ public class NotificationChildrenContainer extends ViewGroup @VisibleForTesting static final int NUMBER_OF_CHILDREN_WHEN_COLLAPSED = 2; @VisibleForTesting static final int NUMBER_OF_CHILDREN_WHEN_COLLAPSED_BUNDLED = 5; @VisibleForTesting static final int NUMBER_OF_CHILDREN_WHEN_SYSTEM_EXPANDED = 5; public static final int NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED = 8; private static final AnimationProperties ALPHA_FADE_IN = new AnimationProperties() { Loading Loading @@ -1040,9 +1038,6 @@ public class NotificationChildrenContainer extends ViewGroup if (isBundle()) { return NUMBER_OF_CHILDREN_BUNDLE_COLLAPSED; } else { if (getContainingNotification().getEntryAdapter().isBundled()) { return NUMBER_OF_CHILDREN_WHEN_COLLAPSED_BUNDLED; } return NUMBER_OF_CHILDREN_WHEN_COLLAPSED; } } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinatorTest.kt +8 −33 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.notification.collection.coordinator import android.app.NotificationChannel import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper.RunWithLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest Loading @@ -29,10 +28,8 @@ import com.android.systemui.statusbar.notification.collection.buildNotificationE import com.android.systemui.statusbar.notification.collection.listbuilder.NotifSection import com.android.systemui.statusbar.notification.collection.listbuilder.OnAfterRenderEntryListener import com.android.systemui.statusbar.notification.collection.listbuilder.OnBeforeRenderListListener import com.android.systemui.statusbar.notification.collection.notifCollection import com.android.systemui.statusbar.notification.collection.provider.SectionStyleProvider import com.android.systemui.statusbar.notification.collection.render.NotifRowController import com.android.systemui.statusbar.notification.shared.NotificationBundleUi import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq Loading Loading @@ -72,8 +69,8 @@ class RowAppearanceCoordinatorTest : SysuiTestCase() { @Before fun setUp() { initMocks(this) coordinator = RowAppearanceCoordinator( mContext, assistantFeedbackController, sectionStyleProvider, kosmos.notifCollection) coordinator = RowAppearanceCoordinator(mContext, assistantFeedbackController, sectionStyleProvider) coordinator.attach(pipeline) beforeRenderListListener = withArgCaptor { verify(pipeline).addOnBeforeRenderListListener(capture()) Loading @@ -92,7 +89,7 @@ class RowAppearanceCoordinatorTest : SysuiTestCase() { } @Test fun testSetSystemExpandedOnlyOnFirstIfNotBundle() { fun testSetSystemExpandedOnlyOnFirst() { whenever(sectionStyleProvider.isMinimizedSection(eq(section1))).thenReturn(false) whenever(sectionStyleProvider.isMinimizedSection(eq(section1))).thenReturn(false) beforeRenderListListener.onBeforeRenderList(listOf(entry1, entry2)) Loading @@ -114,34 +111,12 @@ class RowAppearanceCoordinatorTest : SysuiTestCase() { } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun testSetSystemExpanded_Bundled_NotInGroup() { whenever(sectionStyleProvider.isMinimizedSection(eq(section3))).thenReturn(false) beforeRenderListListener.onBeforeRenderList(listOf(entry3)) afterRenderEntryListener.onAfterRenderEntry(entry3, controller3) verify(controller3).setSystemExpanded(eq(true)) } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun testSetSystemExpanded_Bundled_SingleNotifInGroup() { entry3.sbn.overrideGroupKey = "bundled" whenever(sectionStyleProvider.isMinimizedSection(eq(section3))).thenReturn(false) whenever(kosmos.notifCollection.isOnlyChildInGroup(entry3)).thenReturn(true) beforeRenderListListener.onBeforeRenderList(listOf(entry3)) afterRenderEntryListener.onAfterRenderEntry(entry3, controller3) verify(controller3).setSystemExpanded(eq(true)) } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun testSetSystemExpanded_Bundled_NotMultiChildGroup() { entry3.sbn.overrideGroupKey = "bundled" fun testSetSystemExpandedNeverIfBundled() { whenever(sectionStyleProvider.isMinimizedSection(eq(section1))).thenReturn(false) whenever(sectionStyleProvider.isMinimizedSection(eq(section3))).thenReturn(false) whenever(kosmos.notifCollection.isOnlyChildInGroup(entry3)).thenReturn(false) beforeRenderListListener.onBeforeRenderList(listOf(entry3)) beforeRenderListListener.onBeforeRenderList(listOf(entry1, entry3)) afterRenderEntryListener.onAfterRenderEntry(entry1, controller1) verify(controller1).setSystemExpanded(eq(true)) afterRenderEntryListener.onAfterRenderEntry(entry3, controller3) verify(controller3).setSystemExpanded(eq(false)) } Loading