Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardSurfaceBehindInteractor.kt +6 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart /** * Distance over which the surface behind the keyguard is animated in during a Y-translation Loading Loading @@ -102,8 +103,11 @@ constructor( */ private val isNotificationLaunchAnimationRunningOnKeyguard = notificationLaunchInteractor.isLaunchAnimationRunning .sample(transitionInteractor.finishedKeyguardState) .map { it != KeyguardState.GONE } .sample(transitionInteractor.finishedKeyguardState, ::Pair) .map { (animationRunning, finishedState) -> animationRunning && finishedState != KeyguardState.GONE } .onStart { emit(false) } /** * Whether we're animating the surface, or a notification launch animation is running (which Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardSurfaceBehindInteractorTest.kt +23 −0 Original line number Diff line number Diff line Loading @@ -274,4 +274,27 @@ class KeyguardSurfaceBehindInteractorTest : SysuiTestCase() { runCurrent() assertThat(isAnimatingSurface).isFalse() } @Test fun notificationLaunchFalse_isAnimatingSurfaceFalse() = testScope.runTest { val isAnimatingSurface by collectLastValue(underTest.isAnimatingSurface) transitionRepository.sendTransitionStep( TransitionStep( from = KeyguardState.AOD, to = KeyguardState.LOCKSCREEN, transitionState = TransitionState.STARTED, ) ) transitionRepository.sendTransitionStep( TransitionStep( from = KeyguardState.AOD, to = KeyguardState.LOCKSCREEN, transitionState = TransitionState.FINISHED, ) ) kosmos.notificationLaunchAnimationInteractor.setIsLaunchAnimationRunning(false) runCurrent() assertThat(isAnimatingSurface).isFalse() } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardSurfaceBehindInteractor.kt +6 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart /** * Distance over which the surface behind the keyguard is animated in during a Y-translation Loading Loading @@ -102,8 +103,11 @@ constructor( */ private val isNotificationLaunchAnimationRunningOnKeyguard = notificationLaunchInteractor.isLaunchAnimationRunning .sample(transitionInteractor.finishedKeyguardState) .map { it != KeyguardState.GONE } .sample(transitionInteractor.finishedKeyguardState, ::Pair) .map { (animationRunning, finishedState) -> animationRunning && finishedState != KeyguardState.GONE } .onStart { emit(false) } /** * Whether we're animating the surface, or a notification launch animation is running (which Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardSurfaceBehindInteractorTest.kt +23 −0 Original line number Diff line number Diff line Loading @@ -274,4 +274,27 @@ class KeyguardSurfaceBehindInteractorTest : SysuiTestCase() { runCurrent() assertThat(isAnimatingSurface).isFalse() } @Test fun notificationLaunchFalse_isAnimatingSurfaceFalse() = testScope.runTest { val isAnimatingSurface by collectLastValue(underTest.isAnimatingSurface) transitionRepository.sendTransitionStep( TransitionStep( from = KeyguardState.AOD, to = KeyguardState.LOCKSCREEN, transitionState = TransitionState.STARTED, ) ) transitionRepository.sendTransitionStep( TransitionStep( from = KeyguardState.AOD, to = KeyguardState.LOCKSCREEN, transitionState = TransitionState.FINISHED, ) ) kosmos.notificationLaunchAnimationInteractor.setIsLaunchAnimationRunning(false) runCurrent() assertThat(isAnimatingSurface).isFalse() } }