diff options
| author | 2023-10-02 16:21:31 +0000 | |
|---|---|---|
| committer | 2023-10-02 16:26:31 +0000 | |
| commit | 0e500d92a81ad124ac3f6e11fcc6d86a00b3f7c4 (patch) | |
| tree | 055b83c930a3ad807a5516fa454cd80618f9dc98 | |
| parent | 7831be929b069663a12975258f694a16d0d09aae (diff) | |
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
Bug: 302196044
Change-Id: I404b2bcaea4e88c9e217c2565af9cd55770dc88c
2 files changed, 24 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt index f6ad8290d034..63823385dc21 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt @@ -91,13 +91,18 @@ constructor( init { scope.launch { - // On fingerprint success when the screen is on, go to the home screen - fingerprintUnlockSuccessEvents.sample(powerInteractor.isInteractive).collect { - if (it) { - goToHomeScreen() + // On fingerprint success when the screen is on and not dreaming, go to the home screen + 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/dreaming } - // don't go to the home screen if the authentication is from AOD/dozing/off - } } scope.launch { diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractorTest.kt index 47365457d9e4..1c7073c5f79b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractorTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractorTest.kt @@ -181,6 +181,18 @@ class OccludingAppDeviceEntryInteractorTest : SysuiTestCase() { } @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 { givenOnOccludingApp(false) @@ -315,6 +327,7 @@ class OccludingAppDeviceEntryInteractorTest : SysuiTestCase() { powerRepository.setInteractive(true) keyguardRepository.setKeyguardOccluded(isOnOccludingApp) keyguardRepository.setKeyguardShowing(isOnOccludingApp) + keyguardRepository.setDreaming(false) bouncerRepository.setPrimaryShow(!isOnOccludingApp) bouncerRepository.setAlternateVisible(!isOnOccludingApp) } |