Loading packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerSceneImplTest.kt +37 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import androidx.test.filters.SmallTest import com.android.compose.animation.scene.ObservableTransitionState import com.android.compose.animation.scene.SceneKey import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.flags.Flags Loading @@ -30,8 +31,10 @@ import com.android.systemui.keyguard.shared.model.SuccessFingerprintAuthenticati import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.shade.domain.interactor.enableDualShade import com.android.systemui.shade.domain.interactor.shadeInteractor import com.android.systemui.statusbar.CommandQueue import com.android.systemui.testKosmos Loading Loading @@ -177,6 +180,40 @@ class ShadeControllerSceneImplTest : SysuiTestCase() { verify(testRunnable, times(1)).run() } @Test fun instantCollapseShade_notificationShadeHidden() = testScope.runTest { val currentOverlays by collectLastValue(sceneInteractor.currentOverlays) // GIVEN the dual shade configuration with the notification shade overlay visible kosmos.enableDualShade() runCurrent() sceneInteractor.showOverlay(Overlays.NotificationsShade, "test") assertThat(currentOverlays).isEqualTo(setOf(Overlays.NotificationsShade)) // WHEN shade instantly collapses underTest.instantCollapseShade() // THEN overlay was hidden assertThat(currentOverlays).isEmpty() } @Test fun instantCollapseShade_qsShadeHidden() = testScope.runTest { val currentOverlays by collectLastValue(sceneInteractor.currentOverlays) // GIVEN the dual shade configuration with the QS shade overlay visible kosmos.enableDualShade() runCurrent() sceneInteractor.showOverlay(Overlays.QuickSettingsShade, "test") assertThat(currentOverlays).isEqualTo(setOf(Overlays.QuickSettingsShade)) // WHEN shade instantly collapses underTest.instantCollapseShade() // THEN overlay was hidden assertThat(currentOverlays).isEmpty() } private fun setScene(key: SceneKey) { sceneInteractor.changeScene(key, "test") sceneInteractor.setTransitionState( Loading packages/SystemUI/src/com/android/systemui/shade/ShadeControllerSceneImpl.kt +5 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,11 @@ constructor( loggingReason = "ShadeControllerSceneImpl.instantCollapseShade", transitionKey = Instant, ) shadeInteractor.collapseQuickSettingsShade( loggingReason = "ShadeControllerSceneImpl.instantCollapseShade", transitionKey = Instant, ) } override fun animateCollapseShade( Loading packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorSceneContainerImpl.kt +24 −12 Original line number Diff line number Diff line Loading @@ -187,12 +187,18 @@ constructor( override fun collapseNotificationsShade(loggingReason: String, transitionKey: TransitionKey?) { if (shadeModeInteractor.isDualShade) { // TODO(b/356596436): Hide without animation if transitionKey is Instant. if (transitionKey == Instant) { sceneInteractor.instantlyHideOverlay( overlay = Overlays.NotificationsShade, loggingReason = loggingReason, ) } else { sceneInteractor.hideOverlay( overlay = Overlays.NotificationsShade, loggingReason = loggingReason, transitionKey = transitionKey, ) } } else if (transitionKey == Instant) { // TODO(b/356596436): Define instant transition instead of snapToScene(). sceneInteractor.snapToScene( Loading @@ -215,12 +221,18 @@ constructor( bypassNotificationsShade: Boolean, ) { if (shadeModeInteractor.isDualShade) { // TODO(b/356596436): Hide without animation if transitionKey is Instant. if (transitionKey == Instant) { sceneInteractor.instantlyHideOverlay( overlay = Overlays.QuickSettingsShade, loggingReason = loggingReason, ) } else { sceneInteractor.hideOverlay( overlay = Overlays.QuickSettingsShade, loggingReason = loggingReason, transitionKey = transitionKey, ) } return } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerSceneImplTest.kt +37 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import androidx.test.filters.SmallTest import com.android.compose.animation.scene.ObservableTransitionState import com.android.compose.animation.scene.SceneKey import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.flags.Flags Loading @@ -30,8 +31,10 @@ import com.android.systemui.keyguard.shared.model.SuccessFingerprintAuthenticati import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.shade.domain.interactor.enableDualShade import com.android.systemui.shade.domain.interactor.shadeInteractor import com.android.systemui.statusbar.CommandQueue import com.android.systemui.testKosmos Loading Loading @@ -177,6 +180,40 @@ class ShadeControllerSceneImplTest : SysuiTestCase() { verify(testRunnable, times(1)).run() } @Test fun instantCollapseShade_notificationShadeHidden() = testScope.runTest { val currentOverlays by collectLastValue(sceneInteractor.currentOverlays) // GIVEN the dual shade configuration with the notification shade overlay visible kosmos.enableDualShade() runCurrent() sceneInteractor.showOverlay(Overlays.NotificationsShade, "test") assertThat(currentOverlays).isEqualTo(setOf(Overlays.NotificationsShade)) // WHEN shade instantly collapses underTest.instantCollapseShade() // THEN overlay was hidden assertThat(currentOverlays).isEmpty() } @Test fun instantCollapseShade_qsShadeHidden() = testScope.runTest { val currentOverlays by collectLastValue(sceneInteractor.currentOverlays) // GIVEN the dual shade configuration with the QS shade overlay visible kosmos.enableDualShade() runCurrent() sceneInteractor.showOverlay(Overlays.QuickSettingsShade, "test") assertThat(currentOverlays).isEqualTo(setOf(Overlays.QuickSettingsShade)) // WHEN shade instantly collapses underTest.instantCollapseShade() // THEN overlay was hidden assertThat(currentOverlays).isEmpty() } private fun setScene(key: SceneKey) { sceneInteractor.changeScene(key, "test") sceneInteractor.setTransitionState( Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeControllerSceneImpl.kt +5 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,11 @@ constructor( loggingReason = "ShadeControllerSceneImpl.instantCollapseShade", transitionKey = Instant, ) shadeInteractor.collapseQuickSettingsShade( loggingReason = "ShadeControllerSceneImpl.instantCollapseShade", transitionKey = Instant, ) } override fun animateCollapseShade( Loading
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorSceneContainerImpl.kt +24 −12 Original line number Diff line number Diff line Loading @@ -187,12 +187,18 @@ constructor( override fun collapseNotificationsShade(loggingReason: String, transitionKey: TransitionKey?) { if (shadeModeInteractor.isDualShade) { // TODO(b/356596436): Hide without animation if transitionKey is Instant. if (transitionKey == Instant) { sceneInteractor.instantlyHideOverlay( overlay = Overlays.NotificationsShade, loggingReason = loggingReason, ) } else { sceneInteractor.hideOverlay( overlay = Overlays.NotificationsShade, loggingReason = loggingReason, transitionKey = transitionKey, ) } } else if (transitionKey == Instant) { // TODO(b/356596436): Define instant transition instead of snapToScene(). sceneInteractor.snapToScene( Loading @@ -215,12 +221,18 @@ constructor( bypassNotificationsShade: Boolean, ) { if (shadeModeInteractor.isDualShade) { // TODO(b/356596436): Hide without animation if transitionKey is Instant. if (transitionKey == Instant) { sceneInteractor.instantlyHideOverlay( overlay = Overlays.QuickSettingsShade, loggingReason = loggingReason, ) } else { sceneInteractor.hideOverlay( overlay = Overlays.QuickSettingsShade, loggingReason = loggingReason, transitionKey = transitionKey, ) } return } Loading