Loading packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/UdfpsKeyguardViewLegacyControllerWithCoroutinesTest.kt +26 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,32 @@ class UdfpsKeyguardViewLegacyControllerWithCoroutinesTest : } @Test fun shouldHandleTouchesOnDetach() = testScope.runTest { val shouldHandleTouches by collectLastValue(mUdfpsOverlayInteractor.shouldHandleTouches) // GIVEN view is attached + on the keyguard mController.onViewAttached() captureStatusBarStateListeners() sendStatusBarStateChanged(StatusBarState.KEYGUARD) whenever(mView.setPauseAuth(true)).thenReturn(true) whenever(mView.unpausedAlpha).thenReturn(0) // WHEN panelViewExpansion changes to expanded val job = mController.listenForBouncerExpansion(this) keyguardBouncerRepository.setPrimaryShow(true) keyguardBouncerRepository.setPanelExpansion(KeyguardBouncerConstants.EXPANSION_VISIBLE) runCurrent() mController.onViewDetached() // THEN UDFPS auth is paused and should not handle touches assertThat(mController.shouldPauseAuth()).isTrue() assertThat(shouldHandleTouches!!).isFalse() job.cancel() } @Test fun fadeFromDialogSuggestedAlpha() = testScope.runTest { // GIVEN view is attached and status bar expansion is 1f Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.kt +2 −2 Original line number Diff line number Diff line Loading @@ -132,13 +132,13 @@ abstract class UdfpsAnimationViewController<T : UdfpsAnimationView>( override fun onViewAttached() { dialogManager.registerListener(dialogListener) dumpManager.registerDumpable(dumpTag, this) udfpsOverlayInteractor.setHandleTouches(shouldHandle = true) udfpsOverlayInteractor.setHandleTouches(shouldHandle = !shouldPauseAuth()) } override fun onViewDetached() { dialogManager.unregisterListener(dialogListener) dumpManager.unregisterDumpable(dumpTag) udfpsOverlayInteractor.setHandleTouches(shouldHandle = true) udfpsOverlayInteractor.setHandleTouches(shouldHandle = !shouldPauseAuth()) } /** Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerLegacy.kt +1 −1 Original line number Diff line number Diff line Loading @@ -378,7 +378,7 @@ open class UdfpsKeyguardViewControllerLegacy( } } override fun onViewDetached() { public override fun onViewDetached() { super.onViewDetached() alternateBouncerInteractor.setAlternateBouncerUIAvailable(false, uniqueIdentifier) faceDetectRunning = false Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/UdfpsKeyguardViewLegacyControllerWithCoroutinesTest.kt +26 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,32 @@ class UdfpsKeyguardViewLegacyControllerWithCoroutinesTest : } @Test fun shouldHandleTouchesOnDetach() = testScope.runTest { val shouldHandleTouches by collectLastValue(mUdfpsOverlayInteractor.shouldHandleTouches) // GIVEN view is attached + on the keyguard mController.onViewAttached() captureStatusBarStateListeners() sendStatusBarStateChanged(StatusBarState.KEYGUARD) whenever(mView.setPauseAuth(true)).thenReturn(true) whenever(mView.unpausedAlpha).thenReturn(0) // WHEN panelViewExpansion changes to expanded val job = mController.listenForBouncerExpansion(this) keyguardBouncerRepository.setPrimaryShow(true) keyguardBouncerRepository.setPanelExpansion(KeyguardBouncerConstants.EXPANSION_VISIBLE) runCurrent() mController.onViewDetached() // THEN UDFPS auth is paused and should not handle touches assertThat(mController.shouldPauseAuth()).isTrue() assertThat(shouldHandleTouches!!).isFalse() job.cancel() } @Test fun fadeFromDialogSuggestedAlpha() = testScope.runTest { // GIVEN view is attached and status bar expansion is 1f Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.kt +2 −2 Original line number Diff line number Diff line Loading @@ -132,13 +132,13 @@ abstract class UdfpsAnimationViewController<T : UdfpsAnimationView>( override fun onViewAttached() { dialogManager.registerListener(dialogListener) dumpManager.registerDumpable(dumpTag, this) udfpsOverlayInteractor.setHandleTouches(shouldHandle = true) udfpsOverlayInteractor.setHandleTouches(shouldHandle = !shouldPauseAuth()) } override fun onViewDetached() { dialogManager.unregisterListener(dialogListener) dumpManager.unregisterDumpable(dumpTag) udfpsOverlayInteractor.setHandleTouches(shouldHandle = true) udfpsOverlayInteractor.setHandleTouches(shouldHandle = !shouldPauseAuth()) } /** Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerLegacy.kt +1 −1 Original line number Diff line number Diff line Loading @@ -378,7 +378,7 @@ open class UdfpsKeyguardViewControllerLegacy( } } override fun onViewDetached() { public override fun onViewDetached() { super.onViewDetached() alternateBouncerInteractor.setAlternateBouncerUIAvailable(false, uniqueIdentifier) faceDetectRunning = false Loading