From 7e0e3e84b529a3536f3622fa6c11a6897678ee64 Mon Sep 17 00:00:00 2001 From: Beverly Date: Tue, 3 Aug 2021 10:38:57 -0400 Subject: [PATCH] Retain udfps auth bouncer after orientation change But also make sure to reset the auth bouncer state after hiding the udfps overlay Test: manual, atest UdfpsControllerTest Fixes: 194868950 Change-Id: I2849615795c43d0fbb213415f804c396f9259442 --- .../systemui/biometrics/UdfpsController.java | 10 ++++++++++ .../biometrics/UdfpsKeyguardViewController.java | 6 ++++++ .../phone/StatusBarKeyguardViewManager.java | 6 ++++-- .../systemui/biometrics/UdfpsControllerTest.java | 15 +++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java index 894d1157e5607..8814e4dcaedbb 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java @@ -706,15 +706,21 @@ public class UdfpsController implements DozeReceiver { return mCoreLayoutParams; } + private void onOrientationChanged() { // When the configuration changes it's almost always necessary to destroy and re-create // the overlay's window to pass it the new LayoutParams. // Hiding the overlay will destroy its window. It's safe to hide the overlay regardless // of whether it is already hidden. + final boolean wasShowingAltAuth = mKeyguardViewManager.isShowingAlternateAuth(); hideUdfpsOverlay(); + // If the overlay needs to be shown, this will re-create and show the overlay with the // updated LayoutParams. Otherwise, the overlay will remain hidden. updateOverlay(); + if (wasShowingAltAuth) { + mKeyguardViewManager.showGenericBouncer(true); + } } private void showUdfpsOverlay(@NonNull ServerRequest request) { @@ -820,10 +826,14 @@ public class UdfpsController implements DozeReceiver { Log.v(TAG, "hideUdfpsOverlay | removing window"); // Reset the controller back to its starting state. onFingerUp(); + boolean wasShowingAltAuth = mKeyguardViewManager.isShowingAlternateAuth(); mWindowManager.removeView(mView); mView.setOnTouchListener(null); mView.setOnHoverListener(null); mView.setAnimationViewController(null); + if (wasShowingAltAuth) { + mKeyguardViewManager.resetAlternateAuth(true); + } mAccessibilityManager.removeTouchExplorationStateChangeListener( mTouchExplorationStateChangeListener); mView = null; diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java index 55f7f7204d608..e850b2d88e820 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java @@ -100,6 +100,12 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController