Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt +11 −6 Original line number Original line Diff line number Diff line Loading @@ -91,12 +91,17 @@ constructor( init { init { scope.launch { scope.launch { // On fingerprint success when the screen is on, go to the home screen // On fingerprint success when the screen is on and not dreaming, go to the home screen fingerprintUnlockSuccessEvents.sample(powerInteractor.isInteractive).collect { fingerprintUnlockSuccessEvents if (it) { .sample( combine(powerInteractor.isInteractive, keyguardInteractor.isDreaming, ::Pair), ) .collect { (interactive, dreaming) -> if (interactive && !dreaming) { goToHomeScreen() 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 Original line Diff line number Diff line Loading @@ -180,6 +180,18 @@ class OccludingAppDeviceEntryInteractorTest : SysuiTestCase() { verifyNeverGoToHomeScreen() verifyNeverGoToHomeScreen() } } @Test fun fingerprintSuccess_dreaming_doesNotGoToHomeScreen() = testScope.runTest { givenOnOccludingApp(true) keyguardRepository.setDreaming(true) fingerprintAuthRepository.setAuthenticationStatus( SuccessFingerprintAuthenticationStatus(0, true) ) runCurrent() verifyNeverGoToHomeScreen() } @Test @Test fun fingerprintSuccess_notOnOccludingApp_doesNotGoToHomeScreen() = fun fingerprintSuccess_notOnOccludingApp_doesNotGoToHomeScreen() = testScope.runTest { testScope.runTest { Loading Loading @@ -315,6 +327,7 @@ class OccludingAppDeviceEntryInteractorTest : SysuiTestCase() { powerRepository.setInteractive(true) powerRepository.setInteractive(true) keyguardRepository.setKeyguardOccluded(isOnOccludingApp) keyguardRepository.setKeyguardOccluded(isOnOccludingApp) keyguardRepository.setKeyguardShowing(isOnOccludingApp) keyguardRepository.setKeyguardShowing(isOnOccludingApp) keyguardRepository.setDreaming(false) bouncerRepository.setPrimaryShow(!isOnOccludingApp) bouncerRepository.setPrimaryShow(!isOnOccludingApp) bouncerRepository.setAlternateVisible(!isOnOccludingApp) bouncerRepository.setAlternateVisible(!isOnOccludingApp) } } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/OccludingAppDeviceEntryInteractor.kt +11 −6 Original line number Original line Diff line number Diff line Loading @@ -91,12 +91,17 @@ constructor( init { init { scope.launch { scope.launch { // On fingerprint success when the screen is on, go to the home screen // On fingerprint success when the screen is on and not dreaming, go to the home screen fingerprintUnlockSuccessEvents.sample(powerInteractor.isInteractive).collect { fingerprintUnlockSuccessEvents if (it) { .sample( combine(powerInteractor.isInteractive, keyguardInteractor.isDreaming, ::Pair), ) .collect { (interactive, dreaming) -> if (interactive && !dreaming) { goToHomeScreen() 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 Original line Diff line number Diff line Loading @@ -180,6 +180,18 @@ class OccludingAppDeviceEntryInteractorTest : SysuiTestCase() { verifyNeverGoToHomeScreen() verifyNeverGoToHomeScreen() } } @Test fun fingerprintSuccess_dreaming_doesNotGoToHomeScreen() = testScope.runTest { givenOnOccludingApp(true) keyguardRepository.setDreaming(true) fingerprintAuthRepository.setAuthenticationStatus( SuccessFingerprintAuthenticationStatus(0, true) ) runCurrent() verifyNeverGoToHomeScreen() } @Test @Test fun fingerprintSuccess_notOnOccludingApp_doesNotGoToHomeScreen() = fun fingerprintSuccess_notOnOccludingApp_doesNotGoToHomeScreen() = testScope.runTest { testScope.runTest { Loading Loading @@ -315,6 +327,7 @@ class OccludingAppDeviceEntryInteractorTest : SysuiTestCase() { powerRepository.setInteractive(true) powerRepository.setInteractive(true) keyguardRepository.setKeyguardOccluded(isOnOccludingApp) keyguardRepository.setKeyguardOccluded(isOnOccludingApp) keyguardRepository.setKeyguardShowing(isOnOccludingApp) keyguardRepository.setKeyguardShowing(isOnOccludingApp) keyguardRepository.setDreaming(false) bouncerRepository.setPrimaryShow(!isOnOccludingApp) bouncerRepository.setPrimaryShow(!isOnOccludingApp) bouncerRepository.setAlternateVisible(!isOnOccludingApp) bouncerRepository.setAlternateVisible(!isOnOccludingApp) } } Loading