diff options
| author | 2022-12-17 01:54:13 +0000 | |
|---|---|---|
| committer | 2022-12-17 01:54:13 +0000 | |
| commit | 76c5ba50f20bea7a8365cb4eaacdfcde9af9f62a (patch) | |
| tree | cd05225de0353295a5e1032c4e0feb9447c03e15 | |
| parent | 98ac3bd2cb86bb7e2380151c78ce8a002227a555 (diff) | |
| parent | 4dd99003610583b110496321fcf092ddd78f0531 (diff) | |
Merge "[Bouncer] Do not send message if face auth..." into tm-qpr-dev
7 files changed, 26 insertions, 15 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java index 7da27b1d6898..baaef1983e9c 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java @@ -103,6 +103,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey @Override public void reset() { + super.reset(); // start fresh mDismissing = false; mView.resetPasswordText(false /* animate */, false /* announce */); diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java index d1c9a3090860..b143c5b90373 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java @@ -121,6 +121,7 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView> @Override public void reset() { + mMessageAreaController.setMessage("", false); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt index f772b17a7fb6..3d5985c5c7aa 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt @@ -105,14 +105,6 @@ object KeyguardBouncerViewBinder { } launch { - viewModel.showWithFullExpansion.collect { model -> - hostViewController.resetSecurityContainer() - hostViewController.showPromptReason(model.promptReason) - hostViewController.onResume() - } - } - - launch { viewModel.hide.collect { hostViewController.cancelDismissAction() hostViewController.cleanUp() diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt index e5d4e4971baa..737c35d866c2 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt @@ -22,10 +22,8 @@ import com.android.systemui.keyguard.data.BouncerViewDelegate import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor import com.android.systemui.keyguard.shared.model.BouncerShowMessageModel import com.android.systemui.keyguard.shared.model.KeyguardBouncerModel -import com.android.systemui.statusbar.phone.KeyguardBouncer.EXPANSION_VISIBLE import javax.inject.Inject import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.map /** Models UI state for the lock screen bouncer; handles user input. */ @@ -44,10 +42,6 @@ constructor( /** Observe whether bouncer is showing. */ val show: Flow<KeyguardBouncerModel> = interactor.show - /** Observe visible expansion when bouncer is showing. */ - val showWithFullExpansion: Flow<KeyguardBouncerModel> = - interactor.show.filter { it.expansionAmount == EXPANSION_VISIBLE } - /** Observe whether bouncer is hiding. */ val hide: Flow<Unit> = interactor.hide diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index b7001e476dcf..770a23604b00 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -930,7 +930,8 @@ public class KeyguardIndicationController { if (mStatusBarKeyguardViewManager.isBouncerShowing()) { if (mStatusBarKeyguardViewManager.isShowingAlternateBouncer()) { return; // udfps affordance is highlighted, no need to show action to unlock - } else if (mKeyguardUpdateMonitor.isFaceEnrolled()) { + } else if (!mKeyguardUpdateMonitor.getIsFaceAuthenticated() + && mKeyguardUpdateMonitor.isFaceEnrolled()) { String message = mContext.getString(R.string.keyguard_retry); mStatusBarKeyguardViewManager.setKeyguardMessage(message, mInitialTextColorState); } diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java index 10595439200a..fa9bab28d5d8 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java @@ -150,4 +150,10 @@ public class KeyguardAbsKeyInputViewControllerTest extends SysuiTestCase { getContext().getResources().getString(R.string.kg_prompt_reason_restart_password), false); } + + @Test + public void testReset() { + mKeyguardAbsKeyInputViewController.reset(); + verify(mKeyguardMessageAreaController).setMessage("", false); + } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java index 8d96932f0051..99b58a3a30fe 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java @@ -660,6 +660,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { createController(); String message = mContext.getString(R.string.keyguard_retry); when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true); + when(mKeyguardUpdateMonitor.getIsFaceAuthenticated()).thenReturn(false); when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true); mController.setVisible(true); @@ -670,6 +671,21 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase { } @Test + public void transientIndication_swipeUpToRetry_faceAuthenticated() { + createController(); + String message = mContext.getString(R.string.keyguard_retry); + when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true); + when(mKeyguardUpdateMonitor.getIsFaceAuthenticated()).thenReturn(true); + when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true); + + mController.setVisible(true); + mController.getKeyguardCallback().onBiometricError(FACE_ERROR_TIMEOUT, + "A message", BiometricSourceType.FACE); + + verify(mStatusBarKeyguardViewManager, never()).setKeyguardMessage(eq(message), any()); + } + + @Test public void faceErrorTimeout_whenFingerprintEnrolled_doesNotShowMessage() { createController(); when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible( |