Loading packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractorTest.kt +25 −16 Original line number Diff line number Diff line Loading @@ -353,22 +353,6 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() { assertThat(faceAuthRepository.runningAuthRequest.value!!.second).isEqualTo(false) } @Test @DisableSceneContainer fun faceAuthIsRequestedWhenPrimaryBouncerIsVisible() = testScope.runTest { underTest.start() bouncerRepository.setPrimaryShow(false) runCurrent() bouncerRepository.setPrimaryShow(true) runCurrent() assertThat(faceAuthRepository.runningAuthRequest.value) .isEqualTo(Pair(FaceAuthUiEvent.FACE_AUTH_UPDATED_PRIMARY_BOUNCER_SHOWN, false)) } @Test @EnableSceneContainer fun faceAuthIsRequestedWhenPrimaryBouncerIsVisible_withSceneContainerEnabled() = Loading @@ -389,6 +373,7 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() { } @Test @DisableSceneContainer fun faceAuthIsRequestedWhenPrimaryBouncerIsAboutToShow() = testScope.runTest { underTest.start() Loading @@ -408,6 +393,30 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() { ) } @Test @DisableSceneContainer fun faceAuthIsOnlyRequestedWhenPrimaryBouncerIsAboutToShow() = testScope.runTest { underTest.start() bouncerRepository.setPrimaryShowingSoon(false) bouncerRepository.setPrimaryShow(false) runCurrent() bouncerRepository.setPrimaryShowingSoon(true) runCurrent() bouncerRepository.setPrimaryShow(true) runCurrent() assertThat(faceAuthRepository.runningAuthRequest.value) .isEqualTo( Pair( FaceAuthUiEvent.FACE_AUTH_UPDATED_PRIMARY_BOUNCER_SHOWN_OR_WILL_BE_SHOWN, false, ) ) } @Test @EnableSceneContainer fun withSceneContainerEnabled_faceAuthIsRequestedWhenPrimaryBouncerIsVisible() = Loading packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt +27 −20 Original line number Diff line number Diff line Loading @@ -116,6 +116,8 @@ constructor( keyguardUpdateMonitor.setFaceAuthInteractor(this) observeFaceAuthStateUpdates() faceAuthenticationLogger.interactorStarted() if (SceneContainerFlag.isEnabled) { isBouncerVisible .whenItFlipsToTrue() .onEach { Loading @@ -126,7 +128,11 @@ constructor( ) } .launchIn(applicationScope) } else { // When face auth can run, `isBouncerShowingSoon` will always gets triggered before // `isBouncerVisible`. Only run face auth when `isBouncerShowingSoon` (and not // `isBouncerVisible` to avoid running face auth twice for a single transition // to the primary bouncer. isBouncerShowingSoon .whenItFlipsToTrue() .onEach { Loading @@ -137,6 +143,7 @@ constructor( ) } .launchIn(applicationScope) } alternateBouncerInteractor.isVisible .whenItFlipsToTrue() Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractorTest.kt +25 −16 Original line number Diff line number Diff line Loading @@ -353,22 +353,6 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() { assertThat(faceAuthRepository.runningAuthRequest.value!!.second).isEqualTo(false) } @Test @DisableSceneContainer fun faceAuthIsRequestedWhenPrimaryBouncerIsVisible() = testScope.runTest { underTest.start() bouncerRepository.setPrimaryShow(false) runCurrent() bouncerRepository.setPrimaryShow(true) runCurrent() assertThat(faceAuthRepository.runningAuthRequest.value) .isEqualTo(Pair(FaceAuthUiEvent.FACE_AUTH_UPDATED_PRIMARY_BOUNCER_SHOWN, false)) } @Test @EnableSceneContainer fun faceAuthIsRequestedWhenPrimaryBouncerIsVisible_withSceneContainerEnabled() = Loading @@ -389,6 +373,7 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() { } @Test @DisableSceneContainer fun faceAuthIsRequestedWhenPrimaryBouncerIsAboutToShow() = testScope.runTest { underTest.start() Loading @@ -408,6 +393,30 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() { ) } @Test @DisableSceneContainer fun faceAuthIsOnlyRequestedWhenPrimaryBouncerIsAboutToShow() = testScope.runTest { underTest.start() bouncerRepository.setPrimaryShowingSoon(false) bouncerRepository.setPrimaryShow(false) runCurrent() bouncerRepository.setPrimaryShowingSoon(true) runCurrent() bouncerRepository.setPrimaryShow(true) runCurrent() assertThat(faceAuthRepository.runningAuthRequest.value) .isEqualTo( Pair( FaceAuthUiEvent.FACE_AUTH_UPDATED_PRIMARY_BOUNCER_SHOWN_OR_WILL_BE_SHOWN, false, ) ) } @Test @EnableSceneContainer fun withSceneContainerEnabled_faceAuthIsRequestedWhenPrimaryBouncerIsVisible() = Loading
packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt +27 −20 Original line number Diff line number Diff line Loading @@ -116,6 +116,8 @@ constructor( keyguardUpdateMonitor.setFaceAuthInteractor(this) observeFaceAuthStateUpdates() faceAuthenticationLogger.interactorStarted() if (SceneContainerFlag.isEnabled) { isBouncerVisible .whenItFlipsToTrue() .onEach { Loading @@ -126,7 +128,11 @@ constructor( ) } .launchIn(applicationScope) } else { // When face auth can run, `isBouncerShowingSoon` will always gets triggered before // `isBouncerVisible`. Only run face auth when `isBouncerShowingSoon` (and not // `isBouncerVisible` to avoid running face auth twice for a single transition // to the primary bouncer. isBouncerShowingSoon .whenItFlipsToTrue() .onEach { Loading @@ -137,6 +143,7 @@ constructor( ) } .launchIn(applicationScope) } alternateBouncerInteractor.isVisible .whenItFlipsToTrue() Loading