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

Commit 3e80f6fb authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

From dream, FP auth brings you to the last app

Instead of dismissing the activity and bringing
the user to the home screen/launcher.

Test: atest OccludingAppDeviceEntryInteractorTest
Test: use an app and then wait for timeout to dream. When
authenticating with SFPS from the dream, the last app
shows after authentication
Fixes: 302196044

Change-Id: I404b2bcaea4e88c9e217c2565af9cd55770dc88c
Merged-In: I404b2bcaea4e88c9e217c2565af9cd55770dc88c
parent 6128a3ab
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)
    }