Loading packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/UdfpsKeyguardViewLegacyControllerWithCoroutinesTest.kt +24 −0 Original line number Diff line number Diff line Loading @@ -616,4 +616,28 @@ class UdfpsKeyguardViewLegacyControllerWithCoroutinesTest : .onDozeAmountChanged(eq(.3f), eq(.3f), eq(ANIMATION_BETWEEN_AOD_AND_LOCKSCREEN)) job.cancel() } @Test fun bouncerToAod_dozeAmountChanged() = testScope.runTest { // GIVEN view is attached mController.onViewAttached() Mockito.reset(mView) val job = mController.listenForPrimaryBouncerToAodTransitions(this) // WHEN alternate bouncer to aod transition in progress transitionRepository.sendTransitionStep( TransitionStep( from = KeyguardState.PRIMARY_BOUNCER, to = KeyguardState.AOD, value = .3f, transitionState = TransitionState.RUNNING ) ) runCurrent() // THEN doze amount is updated to verify(mView).onDozeAmountChanged(eq(.3f), eq(.3f), eq(ANIMATE_APPEAR_ON_SCREEN_OFF)) job.cancel() } } packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerLegacy.kt +16 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,22 @@ open class UdfpsKeyguardViewControllerLegacy( listenForAodToOccludedTransitions(this) listenForAlternateBouncerToAodTransitions(this) listenForDreamingToAodTransitions(this) listenForPrimaryBouncerToAodTransitions(this) } } } @VisibleForTesting suspend fun listenForPrimaryBouncerToAodTransitions(scope: CoroutineScope): Job { return scope.launch { transitionInteractor .transition(KeyguardState.PRIMARY_BOUNCER, KeyguardState.AOD) .collect { transitionStep -> view.onDozeAmountChanged( transitionStep.value, transitionStep.value, ANIMATE_APPEAR_ON_SCREEN_OFF, ) } } } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/UdfpsKeyguardViewLegacyControllerWithCoroutinesTest.kt +24 −0 Original line number Diff line number Diff line Loading @@ -616,4 +616,28 @@ class UdfpsKeyguardViewLegacyControllerWithCoroutinesTest : .onDozeAmountChanged(eq(.3f), eq(.3f), eq(ANIMATION_BETWEEN_AOD_AND_LOCKSCREEN)) job.cancel() } @Test fun bouncerToAod_dozeAmountChanged() = testScope.runTest { // GIVEN view is attached mController.onViewAttached() Mockito.reset(mView) val job = mController.listenForPrimaryBouncerToAodTransitions(this) // WHEN alternate bouncer to aod transition in progress transitionRepository.sendTransitionStep( TransitionStep( from = KeyguardState.PRIMARY_BOUNCER, to = KeyguardState.AOD, value = .3f, transitionState = TransitionState.RUNNING ) ) runCurrent() // THEN doze amount is updated to verify(mView).onDozeAmountChanged(eq(.3f), eq(.3f), eq(ANIMATE_APPEAR_ON_SCREEN_OFF)) job.cancel() } }
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerLegacy.kt +16 −0 Original line number Diff line number Diff line Loading @@ -199,6 +199,22 @@ open class UdfpsKeyguardViewControllerLegacy( listenForAodToOccludedTransitions(this) listenForAlternateBouncerToAodTransitions(this) listenForDreamingToAodTransitions(this) listenForPrimaryBouncerToAodTransitions(this) } } } @VisibleForTesting suspend fun listenForPrimaryBouncerToAodTransitions(scope: CoroutineScope): Job { return scope.launch { transitionInteractor .transition(KeyguardState.PRIMARY_BOUNCER, KeyguardState.AOD) .collect { transitionStep -> view.onDozeAmountChanged( transitionStep.value, transitionStep.value, ANIMATE_APPEAR_ON_SCREEN_OFF, ) } } } Loading