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

Commit 656a4ce5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

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

parents 21cd0106 572daed4
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)
    }