summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beverly Tai <beverlyt@google.com> 2023-10-02 21:06:18 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-10-02 21:06:18 +0000
commit14a320dc5fe6bb322f8b27ffff9cf857bc8fdd17 (patch)
tree2641b1f3702e4aa0f5c50504079cbb4717cb4d03
parent85c13088ebfc0abe282653c388106494a55c69ed (diff)
parent0e500d92a81ad124ac3f6e11fcc6d86a00b3f7c4 (diff)
Merge "From dream, FP auth brings you to the last app" into main
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt17
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractorTest.kt13
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)
}