Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 572daed4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "From dream, FP auth brings you to the last app" into udc-qpr-dev

parents 6a9b7d2e 3e80f6fb
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -96,11 +96,15 @@ constructor(
        if (featureFlags.isEnabled(Flags.FP_LISTEN_OCCLUDING_APPS)) {
            scope.launch {
                // On fingerprint success when the screen is on, go to the home screen
                fingerprintUnlockSuccessEvents.sample(powerInteractor.isInteractive).collect {
                    if (it) {
                fingerprintUnlockSuccessEvents.sample(
                    combine(powerInteractor.isInteractive, keyguardInteractor.isDreaming, ::Pair),
                )
                .collect { (interactive, dreaming) ->
                    if (interactive && !dreaming) {
                        goToHomeScreen()
                    }
                    // don't go to the home screen if the authentication is from AOD/dozing/off
                    // don't go to the home screen if the authentication is from
                    // AOD/dozing/off/dreaming
                }
            }

+13 −0
Original line number Diff line number Diff line
@@ -183,6 +183,18 @@ class OccludingAppDeviceEntryInteractorTest : SysuiTestCase() {
            verifyNeverGoToHomeScreen()
        }

    @Test
    fun fingerprintSuccess_dreaming_doesNotGoToHomeScreen() =
        testScope.runTest {
            givenOnOccludingApp(true)
            keyguardRepository.setDreaming(true)
            fingerprintAuthRepository.setAuthenticationStatus(
                SuccessFingerprintAuthenticationStatus(0, true)
            )
            runCurrent()
            verifyNeverGoToHomeScreen()
        }

    @Test
    fun fingerprintSuccess_notOnOccludingApp_doesNotGoToHomeScreen() =
        testScope.runTest {
@@ -318,6 +330,7 @@ class OccludingAppDeviceEntryInteractorTest : SysuiTestCase() {
        powerRepository.setInteractive(true)
        keyguardRepository.setKeyguardOccluded(isOnOccludingApp)
        keyguardRepository.setKeyguardShowing(isOnOccludingApp)
        keyguardRepository.setDreaming(false)
        bouncerRepository.setPrimaryShow(!isOnOccludingApp)
        bouncerRepository.setAlternateVisible(!isOnOccludingApp)
    }