Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt +3 −8 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import com.android.systemui.keyguard.shared.model.StatusBarState import com.android.systemui.kosmos.testScope import com.android.systemui.power.data.repository.fakePowerRepository import com.android.systemui.power.shared.model.WakefulnessState import com.android.systemui.res.R import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shade.domain.interactor.enableDualShade import com.android.systemui.shade.domain.interactor.enableSingleShade Loading @@ -42,7 +41,6 @@ import com.android.systemui.statusbar.notification.data.repository.setActiveNoti import com.android.systemui.statusbar.notification.headsup.PinnedStatus import com.android.systemui.statusbar.notification.stack.data.repository.headsUpNotificationRepository import com.android.systemui.statusbar.policy.data.repository.fakeUserSetupRepository import com.android.systemui.statusbar.policy.fakeConfigurationController import com.android.systemui.testKosmos import com.android.systemui.util.ui.isAnimating import com.android.systemui.util.ui.value Loading @@ -69,7 +67,6 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas private val testScope = kosmos.testScope private val activeNotificationListRepository = kosmos.activeNotificationListRepository private val fakeConfigurationController = kosmos.fakeConfigurationController private val fakeKeyguardRepository = kosmos.fakeKeyguardRepository private val fakePowerRepository = kosmos.fakePowerRepository private val fakeRemoteInputRepository = kosmos.fakeRemoteInputRepository Loading Loading @@ -203,10 +200,9 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas activeNotificationListRepository.setActiveNotifs(count = 0) // AND quick settings are expanded shadeTestUtil.setQsExpansion(1f) // AND split shade is expanded overrideResource(R.bool.config_use_split_notification_shade, true) // AND split shade is enabled shadeTestUtil.setShadeExpansion(1f) fakeConfigurationController.notifyConfigurationChanged() shadeTestUtil.setSplitShade(true) runCurrent() // THEN empty shade is visible Loading Loading @@ -387,8 +383,7 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE) shadeTestUtil.setShadeExpansion(1f) // AND split shade is enabled overrideResource(R.bool.config_use_split_notification_shade, true) fakeConfigurationController.notifyConfigurationChanged() shadeTestUtil.setSplitShade(true) runCurrent() // THEN footer is visible Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt +12 −3 Original line number Diff line number Diff line Loading @@ -93,12 +93,17 @@ constructor( val shouldShowEmptyShadeView: Flow<AnimatedValue<Boolean>> by lazy { combine( activeNotificationsInteractor.areAnyNotificationsPresent, shadeInteractor.isQsFullscreen, shadeInteractor.qsExpansion .map { it >= QS_EXPANSION_THRESHOLD } .distinctUntilChanged(), shadeModeInteractor.shadeMode.map { it == ShadeMode.Split }, notificationStackInteractor.isShowingOnLockscreen, ) { hasNotifications, isQsFullScreen, isShowingOnLockscreen -> ) { hasNotifications, qsExpandedEnough, isSplitShade, isShowingOnLockscreen -> when { hasNotifications -> false isQsFullScreen -> false // Hide the empty shade when QS is close to being full screen. We use this // instead of isQsFullscreen to avoid some flickering. qsExpandedEnough && !isSplitShade -> false // Do not show the empty shade if the lockscreen is visible (including AOD // b/228790482 and bouncer b/267060171), except if the shade is opened on // top. Loading Loading @@ -365,4 +370,8 @@ constructor( fun setHeadsUpAnimatingAway(animatingAway: Boolean) { headsUpNotificationInteractor.setHeadsUpAnimatingAway(animatingAway) } companion object { const val QS_EXPANSION_THRESHOLD = 0.9 } } packages/SystemUI/tests/utils/src/com/android/systemui/shade/ShadeTestUtil.kt +4 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,10 @@ class ShadeTestUtil(val delegate: ShadeTestUtilDelegate) { fun setQsFullscreen(qsFullscreen: Boolean) { delegate.assertFlagValid() delegate.setQsFullscreen(qsFullscreen) // If QS is full screen, expansion is 1 and split shade is off. delegate.setQsExpansion(1.0f) delegate.setSplitShade(false) } fun setLegacyExpandedOrAwaitingInputTransfer(legacyExpandedOrAwaitingInputTransfer: Boolean) { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt +3 −8 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import com.android.systemui.keyguard.shared.model.StatusBarState import com.android.systemui.kosmos.testScope import com.android.systemui.power.data.repository.fakePowerRepository import com.android.systemui.power.shared.model.WakefulnessState import com.android.systemui.res.R import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shade.domain.interactor.enableDualShade import com.android.systemui.shade.domain.interactor.enableSingleShade Loading @@ -42,7 +41,6 @@ import com.android.systemui.statusbar.notification.data.repository.setActiveNoti import com.android.systemui.statusbar.notification.headsup.PinnedStatus import com.android.systemui.statusbar.notification.stack.data.repository.headsUpNotificationRepository import com.android.systemui.statusbar.policy.data.repository.fakeUserSetupRepository import com.android.systemui.statusbar.policy.fakeConfigurationController import com.android.systemui.testKosmos import com.android.systemui.util.ui.isAnimating import com.android.systemui.util.ui.value Loading @@ -69,7 +67,6 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas private val testScope = kosmos.testScope private val activeNotificationListRepository = kosmos.activeNotificationListRepository private val fakeConfigurationController = kosmos.fakeConfigurationController private val fakeKeyguardRepository = kosmos.fakeKeyguardRepository private val fakePowerRepository = kosmos.fakePowerRepository private val fakeRemoteInputRepository = kosmos.fakeRemoteInputRepository Loading Loading @@ -203,10 +200,9 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas activeNotificationListRepository.setActiveNotifs(count = 0) // AND quick settings are expanded shadeTestUtil.setQsExpansion(1f) // AND split shade is expanded overrideResource(R.bool.config_use_split_notification_shade, true) // AND split shade is enabled shadeTestUtil.setShadeExpansion(1f) fakeConfigurationController.notifyConfigurationChanged() shadeTestUtil.setSplitShade(true) runCurrent() // THEN empty shade is visible Loading Loading @@ -387,8 +383,7 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE) shadeTestUtil.setShadeExpansion(1f) // AND split shade is enabled overrideResource(R.bool.config_use_split_notification_shade, true) fakeConfigurationController.notifyConfigurationChanged() shadeTestUtil.setSplitShade(true) runCurrent() // THEN footer is visible Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt +12 −3 Original line number Diff line number Diff line Loading @@ -93,12 +93,17 @@ constructor( val shouldShowEmptyShadeView: Flow<AnimatedValue<Boolean>> by lazy { combine( activeNotificationsInteractor.areAnyNotificationsPresent, shadeInteractor.isQsFullscreen, shadeInteractor.qsExpansion .map { it >= QS_EXPANSION_THRESHOLD } .distinctUntilChanged(), shadeModeInteractor.shadeMode.map { it == ShadeMode.Split }, notificationStackInteractor.isShowingOnLockscreen, ) { hasNotifications, isQsFullScreen, isShowingOnLockscreen -> ) { hasNotifications, qsExpandedEnough, isSplitShade, isShowingOnLockscreen -> when { hasNotifications -> false isQsFullScreen -> false // Hide the empty shade when QS is close to being full screen. We use this // instead of isQsFullscreen to avoid some flickering. qsExpandedEnough && !isSplitShade -> false // Do not show the empty shade if the lockscreen is visible (including AOD // b/228790482 and bouncer b/267060171), except if the shade is opened on // top. Loading Loading @@ -365,4 +370,8 @@ constructor( fun setHeadsUpAnimatingAway(animatingAway: Boolean) { headsUpNotificationInteractor.setHeadsUpAnimatingAway(animatingAway) } companion object { const val QS_EXPANSION_THRESHOLD = 0.9 } }
packages/SystemUI/tests/utils/src/com/android/systemui/shade/ShadeTestUtil.kt +4 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,10 @@ class ShadeTestUtil(val delegate: ShadeTestUtilDelegate) { fun setQsFullscreen(qsFullscreen: Boolean) { delegate.assertFlagValid() delegate.setQsFullscreen(qsFullscreen) // If QS is full screen, expansion is 1 and split shade is off. delegate.setQsExpansion(1.0f) delegate.setSplitShade(false) } fun setLegacyExpandedOrAwaitingInputTransfer(legacyExpandedOrAwaitingInputTransfer: Boolean) { Loading