Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt +38 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @Test @EnableSceneContainer fun surfaceBehindVisibility_fromLockscreenToGone_trueThroughout() = fun surfaceBehindVisibility_fromLockscreenToGone_noUserInput_trueThroughout() = testScope.runTest { val isSurfaceBehindVisible by collectLastValue(underTest.value.surfaceBehindVisibility) val currentScene by collectLastValue(kosmos.sceneInteractor.currentScene) Loading Loading @@ -247,6 +247,43 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { assertThat(isSurfaceBehindVisible).isTrue() } @Test @EnableSceneContainer fun surfaceBehindVisibility_fromLockscreenToGone_withUserInput_falseUntilInputStops() = testScope.runTest { val isSurfaceBehindVisible by collectLastValue(underTest.value.surfaceBehindVisibility) val currentScene by collectLastValue(kosmos.sceneInteractor.currentScene) // Before the transition, we start on Lockscreen so the surface should start invisible. kosmos.setSceneTransition(ObservableTransitionState.Idle(Scenes.Lockscreen)) assertThat(currentScene).isEqualTo(Scenes.Lockscreen) assertThat(isSurfaceBehindVisible).isFalse() // Unlocked with fingerprint. kosmos.deviceEntryFingerprintAuthRepository.setAuthenticationStatus( SuccessFingerprintAuthenticationStatus(0, true) ) // Start the transition to Gone, the surface should not be visible while // isUserInputOngoing is true val isUserInputOngoing = MutableStateFlow(true) kosmos.setSceneTransition( ObservableTransitionState.Transition( fromScene = Scenes.Lockscreen, toScene = Scenes.Gone, isInitiatedByUserInput = true, isUserInputOngoing = isUserInputOngoing, progress = flowOf(0.51f), currentScene = flowOf(Scenes.Gone), ) ) assertThat(isSurfaceBehindVisible).isFalse() // When isUserInputOngoing becomes false, then the surface should become visible. isUserInputOngoing.value = false assertThat(isSurfaceBehindVisible).isTrue() } @Test @EnableSceneContainer fun surfaceBehindVisibility_fromBouncerToGone_becomesTrue() = Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractor.kt +11 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,17 @@ constructor( is ObservableTransitionState.Transition -> when { transitionState.fromScene == Scenes.Lockscreen && transitionState.toScene == Scenes.Gone -> flowOf(true) transitionState.toScene == Scenes.Gone -> sceneInteractor .get() .isTransitionUserInputOngoing .flatMapLatestConflated { isUserInputOngoing -> if (isUserInputOngoing) { isDeviceEntered } else { flowOf(true) } } transitionState.fromScene == Scenes.Bouncer && transitionState.toScene == Scenes.Gone -> transitionState.progress.map { progress -> Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt +38 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @Test @EnableSceneContainer fun surfaceBehindVisibility_fromLockscreenToGone_trueThroughout() = fun surfaceBehindVisibility_fromLockscreenToGone_noUserInput_trueThroughout() = testScope.runTest { val isSurfaceBehindVisible by collectLastValue(underTest.value.surfaceBehindVisibility) val currentScene by collectLastValue(kosmos.sceneInteractor.currentScene) Loading Loading @@ -247,6 +247,43 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { assertThat(isSurfaceBehindVisible).isTrue() } @Test @EnableSceneContainer fun surfaceBehindVisibility_fromLockscreenToGone_withUserInput_falseUntilInputStops() = testScope.runTest { val isSurfaceBehindVisible by collectLastValue(underTest.value.surfaceBehindVisibility) val currentScene by collectLastValue(kosmos.sceneInteractor.currentScene) // Before the transition, we start on Lockscreen so the surface should start invisible. kosmos.setSceneTransition(ObservableTransitionState.Idle(Scenes.Lockscreen)) assertThat(currentScene).isEqualTo(Scenes.Lockscreen) assertThat(isSurfaceBehindVisible).isFalse() // Unlocked with fingerprint. kosmos.deviceEntryFingerprintAuthRepository.setAuthenticationStatus( SuccessFingerprintAuthenticationStatus(0, true) ) // Start the transition to Gone, the surface should not be visible while // isUserInputOngoing is true val isUserInputOngoing = MutableStateFlow(true) kosmos.setSceneTransition( ObservableTransitionState.Transition( fromScene = Scenes.Lockscreen, toScene = Scenes.Gone, isInitiatedByUserInput = true, isUserInputOngoing = isUserInputOngoing, progress = flowOf(0.51f), currentScene = flowOf(Scenes.Gone), ) ) assertThat(isSurfaceBehindVisible).isFalse() // When isUserInputOngoing becomes false, then the surface should become visible. isUserInputOngoing.value = false assertThat(isSurfaceBehindVisible).isTrue() } @Test @EnableSceneContainer fun surfaceBehindVisibility_fromBouncerToGone_becomesTrue() = Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractor.kt +11 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,17 @@ constructor( is ObservableTransitionState.Transition -> when { transitionState.fromScene == Scenes.Lockscreen && transitionState.toScene == Scenes.Gone -> flowOf(true) transitionState.toScene == Scenes.Gone -> sceneInteractor .get() .isTransitionUserInputOngoing .flatMapLatestConflated { isUserInputOngoing -> if (isUserInputOngoing) { isDeviceEntered } else { flowOf(true) } } transitionState.fromScene == Scenes.Bouncer && transitionState.toScene == Scenes.Gone -> transitionState.progress.map { progress -> Loading