Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt +16 −13 Original line number Diff line number Diff line Loading @@ -73,6 +73,10 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { /** Helper to strip out the logging reason from the lockscreen visibility flow. */ private val lockscreenVisibilityBoolean by lazy { underTest.lockscreenVisibility.map { it.first } } private val lockscreenSurfaceVisibilityFlow = MutableStateFlow<Boolean?>(false) private val primaryBouncerSurfaceVisibilityFlow = MutableStateFlow<Boolean?>(false) private val surfaceBehindIsAnimatingFlow = MutableStateFlow(false) Loading Loading @@ -536,7 +540,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun lockscreenVisibility_visibleWhenGone() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) // Start on LOCKSCREEN. fakeKeyguardTransitionRepository.sendTransitionStep( Loading Loading @@ -603,7 +607,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun testLockscreenVisibility_usesFromState_ifCanceled() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) fakeKeyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, Loading Loading @@ -698,7 +702,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun testLockscreenVisibility_falseDuringTransitionToGone_fromCanceledGone() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) fakeKeyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, Loading Loading @@ -801,7 +805,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun testLockscreenVisibility_trueDuringTransitionToGone_fromNotCanceledGone() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) fakeKeyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, Loading Loading @@ -917,7 +921,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun testLockscreenVisibility_falseDuringWakeAndUnlockToGone_fromNotCanceledGone() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) fakeKeyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, Loading Loading @@ -1045,7 +1049,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { val currentOverlays by collectLastValue(sceneInteractor.currentOverlays) assertThat(currentScene).isEqualTo(Scenes.Lockscreen) val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isTrue() setSceneTransition(Idle(Scenes.Shade)) Loading Loading @@ -1134,7 +1138,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { val currentScene by collectLastValue(sceneInteractor.currentScene) assertThat(currentScene).isEqualTo(Scenes.Lockscreen) val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isTrue() setSceneTransition(Idle(Scenes.Shade)) Loading Loading @@ -1241,7 +1245,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Lockscreen)) val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isTrue() setSceneTransition(Idle(Scenes.Shade)) Loading Loading @@ -1273,7 +1277,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Lockscreen)) val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isTrue() kosmos.authenticationInteractor.authenticate(FakeAuthenticationRepository.DEFAULT_PIN) Loading @@ -1296,7 +1300,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Gone)) sceneInteractor.changeScene(Scenes.Gone, "") val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isFalse() // Lockscreen vis remains false during Gone -> LS so the unlocked app content is visible Loading @@ -1322,7 +1326,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Gone)) sceneInteractor.changeScene(Scenes.Gone, "") val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isFalse() // Lockscreen vis remains false during Gone -> LS so the unlocked app content is visible Loading Loading @@ -1351,7 +1355,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Gone)) sceneInteractor.changeScene(Scenes.Gone, "") val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isFalse() // Lockscreen vis remains false during Gone -> LS so the unlocked app content is visible Loading @@ -1371,7 +1375,6 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { assertThat(lockscreenVisibility).isFalse() } companion object { private val progress = MutableStateFlow(0f) Loading packages/SystemUI/src/com/android/systemui/actioncorner/domain/interactor/ActionCornerInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ constructor( .distinctUntilChanged() .flatMapLatest { shouldCheckLockscreenVisibility -> if (shouldCheckLockscreenVisibility) { lockscreenVisibilityInteractor.lockscreenVisibility.map { !it } lockscreenVisibilityInteractor.lockscreenVisibility.map { !it.first } } else { flowOf(false) } Loading packages/SystemUI/src/com/android/systemui/keyguard/WindowManagerLockscreenVisibilityManager.kt +6 −5 Original line number Diff line number Diff line Loading @@ -170,17 +170,17 @@ constructor( "setLockscreenShown(true) because we're setting the surface invisible " + "and lockscreen is already showing.", ) setLockscreenShown(true) setLockscreenShown(true, "requested surface invisible w/ lockscreen showing") } } fun setAodVisible(aodVisible: Boolean) { setWmLockscreenState(aodVisible = aodVisible) setWmLockscreenState(aodVisible = aodVisible, reason = "setAodVisible($aodVisible)") } /** Sets the visibility of the lockscreen. */ fun setLockscreenShown(lockscreenShown: Boolean) { setWmLockscreenState(lockscreenShowing = lockscreenShown) fun setLockscreenShown(lockscreenShown: Boolean, reason: String = "") { setWmLockscreenState(lockscreenShowing = lockscreenShown, reason = reason) } /** Loading Loading @@ -284,6 +284,7 @@ constructor( private fun setWmLockscreenState( lockscreenShowing: Boolean? = this.isLockscreenShowing, aodVisible: Boolean = this.isAodVisible, reason: String, ) { if (lockscreenShowing == null) { Log.d( Loading Loading @@ -322,7 +323,7 @@ constructor( TAG, "ATMS#setLockScreenShown(" + "isLockscreenShowing=$lockscreenShowing, " + "aodVisible=$aodVisible).", "aodVisible=$aodVisible): $reason", ) if (enableNewKeyguardShellTransitions) { startKeyguardTransition(lockscreenShowing, aodVisible) Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardServiceShowLockscreenInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ constructor( // This is not the only place we notify the lockNowCallbacks - there are cases where we // decide not to show the lockscreen despite being asked to, and we need to notify the // callback in those cases as well. wmLockscreenVisibilityInteractor.get().lockscreenVisibility.collect { visible -> wmLockscreenVisibilityInteractor.get().lockscreenVisibility.collect { (visible, _) -> if (visible) { notifyShowLockscreenCallbacks() } Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardStateCallbackInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ constructor( } applicationScope.launch { wmLockscreenVisibilityInteractor.lockscreenVisibility.collect { visible -> wmLockscreenVisibilityInteractor.lockscreenVisibility.collect { (visible, _) -> val iterator = callbacks.iterator() withContext(backgroundDispatcher) { while (iterator.hasNext()) { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt +16 −13 Original line number Diff line number Diff line Loading @@ -73,6 +73,10 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { /** Helper to strip out the logging reason from the lockscreen visibility flow. */ private val lockscreenVisibilityBoolean by lazy { underTest.lockscreenVisibility.map { it.first } } private val lockscreenSurfaceVisibilityFlow = MutableStateFlow<Boolean?>(false) private val primaryBouncerSurfaceVisibilityFlow = MutableStateFlow<Boolean?>(false) private val surfaceBehindIsAnimatingFlow = MutableStateFlow(false) Loading Loading @@ -536,7 +540,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun lockscreenVisibility_visibleWhenGone() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) // Start on LOCKSCREEN. fakeKeyguardTransitionRepository.sendTransitionStep( Loading Loading @@ -603,7 +607,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun testLockscreenVisibility_usesFromState_ifCanceled() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) fakeKeyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, Loading Loading @@ -698,7 +702,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun testLockscreenVisibility_falseDuringTransitionToGone_fromCanceledGone() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) fakeKeyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, Loading Loading @@ -801,7 +805,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun testLockscreenVisibility_trueDuringTransitionToGone_fromNotCanceledGone() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) fakeKeyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, Loading Loading @@ -917,7 +921,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { @DisableSceneContainer fun testLockscreenVisibility_falseDuringWakeAndUnlockToGone_fromNotCanceledGone() = kosmos.runTest { val values by collectValues(underTest.lockscreenVisibility) val values by collectValues(lockscreenVisibilityBoolean) fakeKeyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.LOCKSCREEN, Loading Loading @@ -1045,7 +1049,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { val currentOverlays by collectLastValue(sceneInteractor.currentOverlays) assertThat(currentScene).isEqualTo(Scenes.Lockscreen) val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isTrue() setSceneTransition(Idle(Scenes.Shade)) Loading Loading @@ -1134,7 +1138,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { val currentScene by collectLastValue(sceneInteractor.currentScene) assertThat(currentScene).isEqualTo(Scenes.Lockscreen) val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isTrue() setSceneTransition(Idle(Scenes.Shade)) Loading Loading @@ -1241,7 +1245,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Lockscreen)) val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isTrue() setSceneTransition(Idle(Scenes.Shade)) Loading Loading @@ -1273,7 +1277,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Lockscreen)) val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isTrue() kosmos.authenticationInteractor.authenticate(FakeAuthenticationRepository.DEFAULT_PIN) Loading @@ -1296,7 +1300,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Gone)) sceneInteractor.changeScene(Scenes.Gone, "") val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isFalse() // Lockscreen vis remains false during Gone -> LS so the unlocked app content is visible Loading @@ -1322,7 +1326,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Gone)) sceneInteractor.changeScene(Scenes.Gone, "") val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isFalse() // Lockscreen vis remains false during Gone -> LS so the unlocked app content is visible Loading Loading @@ -1351,7 +1355,7 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { setSceneTransition(Idle(Scenes.Gone)) sceneInteractor.changeScene(Scenes.Gone, "") val lockscreenVisibility by collectLastValue(underTest.lockscreenVisibility) val lockscreenVisibility by collectLastValue(lockscreenVisibilityBoolean) assertThat(lockscreenVisibility).isFalse() // Lockscreen vis remains false during Gone -> LS so the unlocked app content is visible Loading @@ -1371,7 +1375,6 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() { assertThat(lockscreenVisibility).isFalse() } companion object { private val progress = MutableStateFlow(0f) Loading
packages/SystemUI/src/com/android/systemui/actioncorner/domain/interactor/ActionCornerInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ constructor( .distinctUntilChanged() .flatMapLatest { shouldCheckLockscreenVisibility -> if (shouldCheckLockscreenVisibility) { lockscreenVisibilityInteractor.lockscreenVisibility.map { !it } lockscreenVisibilityInteractor.lockscreenVisibility.map { !it.first } } else { flowOf(false) } Loading
packages/SystemUI/src/com/android/systemui/keyguard/WindowManagerLockscreenVisibilityManager.kt +6 −5 Original line number Diff line number Diff line Loading @@ -170,17 +170,17 @@ constructor( "setLockscreenShown(true) because we're setting the surface invisible " + "and lockscreen is already showing.", ) setLockscreenShown(true) setLockscreenShown(true, "requested surface invisible w/ lockscreen showing") } } fun setAodVisible(aodVisible: Boolean) { setWmLockscreenState(aodVisible = aodVisible) setWmLockscreenState(aodVisible = aodVisible, reason = "setAodVisible($aodVisible)") } /** Sets the visibility of the lockscreen. */ fun setLockscreenShown(lockscreenShown: Boolean) { setWmLockscreenState(lockscreenShowing = lockscreenShown) fun setLockscreenShown(lockscreenShown: Boolean, reason: String = "") { setWmLockscreenState(lockscreenShowing = lockscreenShown, reason = reason) } /** Loading Loading @@ -284,6 +284,7 @@ constructor( private fun setWmLockscreenState( lockscreenShowing: Boolean? = this.isLockscreenShowing, aodVisible: Boolean = this.isAodVisible, reason: String, ) { if (lockscreenShowing == null) { Log.d( Loading Loading @@ -322,7 +323,7 @@ constructor( TAG, "ATMS#setLockScreenShown(" + "isLockscreenShowing=$lockscreenShowing, " + "aodVisible=$aodVisible).", "aodVisible=$aodVisible): $reason", ) if (enableNewKeyguardShellTransitions) { startKeyguardTransition(lockscreenShowing, aodVisible) Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardServiceShowLockscreenInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ constructor( // This is not the only place we notify the lockNowCallbacks - there are cases where we // decide not to show the lockscreen despite being asked to, and we need to notify the // callback in those cases as well. wmLockscreenVisibilityInteractor.get().lockscreenVisibility.collect { visible -> wmLockscreenVisibilityInteractor.get().lockscreenVisibility.collect { (visible, _) -> if (visible) { notifyShowLockscreenCallbacks() } Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardStateCallbackInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ constructor( } applicationScope.launch { wmLockscreenVisibilityInteractor.lockscreenVisibility.collect { visible -> wmLockscreenVisibilityInteractor.lockscreenVisibility.collect { (visible, _) -> val iterator = callbacks.iterator() withContext(backgroundDispatcher) { while (iterator.hasNext()) { Loading