diff options
2 files changed, 31 insertions, 1 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractorTest.kt index 930096463354..3f2e78cdfb52 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractorTest.kt @@ -39,6 +39,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase +import com.android.systemui.bouncer.data.repository.FakeKeyguardBouncerRepository +import com.android.systemui.bouncer.data.repository.fakeKeyguardBouncerRepository import com.android.systemui.coroutines.collectLastValue import com.android.systemui.keyguard.data.repository.FakeKeyguardTransitionRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository @@ -85,11 +87,13 @@ class FromAodTransitionInteractorTest : SysuiTestCase() { private lateinit var powerInteractor: PowerInteractor private lateinit var transitionRepository: FakeKeyguardTransitionRepository + private lateinit var bouncerRepository: FakeKeyguardBouncerRepository @Before fun setup() { powerInteractor = kosmos.powerInteractor transitionRepository = kosmos.fakeKeyguardTransitionRepositorySpy + bouncerRepository = kosmos.fakeKeyguardBouncerRepository underTest = kosmos.fromAodTransitionInteractor underTest.start() @@ -304,6 +308,29 @@ class FromAodTransitionInteractorTest : SysuiTestCase() { } @Test + fun testWakeAndUnlock_transitionsToGone_evenIfBouncerShows() = + testScope.runTest { + kosmos.fakeKeyguardRepository.setBiometricUnlockState( + BiometricUnlockMode.WAKE_AND_UNLOCK + ) + runCurrent() + bouncerRepository.setPrimaryShow(true) + runCurrent() + powerInteractor.setAwakeForTest() + runCurrent() + + // Waking up from wake and unlock should not start any transitions, we'll wait for the + // dismiss call. + assertThat(transitionRepository).noTransitionsStarted() + + underTest.dismissAod() + advanceTimeBy(100) // account for debouncing + + assertThat(transitionRepository) + .startedTransition(from = KeyguardState.AOD, to = KeyguardState.GONE) + } + + @Test fun testTransitionToOccluded_onWake() = testScope.runTest { kosmos.fakeKeyguardRepository.setKeyguardOccluded(true) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt index 717437923e57..4ad04bef6836 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt @@ -193,7 +193,10 @@ constructor( if (SceneContainerFlag.isEnabled) return scope.launch("$TAG#listenForAodToPrimaryBouncer") { keyguardInteractor.primaryBouncerShowing - .filterRelevantKeyguardStateAnd { primaryBouncerShowing -> primaryBouncerShowing } + .filterRelevantKeyguardStateAnd { primaryBouncerShowing -> + !isWakeAndUnlock(keyguardInteractor.biometricUnlockState.value.mode) && + primaryBouncerShowing + } .collect { startTransitionTo(KeyguardState.PRIMARY_BOUNCER) } } } |