Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt +7 −3 Original line number Diff line number Diff line Loading @@ -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 } } Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractorTest.kt +13 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading @@ -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) } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt +7 −3 Original line number Diff line number Diff line Loading @@ -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 } } Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractorTest.kt +13 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading @@ -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) } Loading