Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +10 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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; Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java +6 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,12 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud return "UdfpsKeyguardViewController"; } @Override public void onInit() { super.onInit(); mKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor); } @Override protected void onViewAttached() { super.onViewAttached(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -303,9 +303,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb * Sets a new alt auth interceptor. */ public void setAlternateAuthInterceptor(@NonNull AlternateAuthInterceptor authInterceptor) { if (!Objects.equals(mAlternateAuthInterceptor, authInterceptor)) { mAlternateAuthInterceptor = authInterceptor; resetAlternateAuth(false); } } private void registerListeners() { mKeyguardUpdateManager.registerCallback(mUpdateMonitorCallback); Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -416,6 +416,21 @@ public class UdfpsControllerTest extends SysuiTestCase { verify(mWindowManager).removeView(eq(mUdfpsView)); } @Test public void hideUdfpsOverlay_resetsAltAuthBouncerWhenShowing() throws RemoteException { // GIVEN overlay was showing and the udfps bouncer is showing mOverlayController.showUdfpsOverlay(TEST_UDFPS_SENSOR_ID, IUdfpsOverlayController.REASON_AUTH_FPM_KEYGUARD, mUdfpsOverlayControllerCallback); when(mStatusBarKeyguardViewManager.isShowingAlternateAuth()).thenReturn(true); // WHEN the overlay is hidden mOverlayController.hideUdfpsOverlay(TEST_UDFPS_SENSOR_ID); mFgExecutor.runAllReady(); // THEN the udfps bouncer is reset verify(mStatusBarKeyguardViewManager).resetAlternateAuth(eq(true)); } @Test public void testSubscribesToOrientationChangesWhenShowingOverlay() throws Exception { mOverlayController.showUdfpsOverlay(TEST_UDFPS_SENSOR_ID, Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +10 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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; Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java +6 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,12 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud return "UdfpsKeyguardViewController"; } @Override public void onInit() { super.onInit(); mKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor); } @Override protected void onViewAttached() { super.onViewAttached(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -303,9 +303,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb * Sets a new alt auth interceptor. */ public void setAlternateAuthInterceptor(@NonNull AlternateAuthInterceptor authInterceptor) { if (!Objects.equals(mAlternateAuthInterceptor, authInterceptor)) { mAlternateAuthInterceptor = authInterceptor; resetAlternateAuth(false); } } private void registerListeners() { mKeyguardUpdateManager.registerCallback(mUpdateMonitorCallback); Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -416,6 +416,21 @@ public class UdfpsControllerTest extends SysuiTestCase { verify(mWindowManager).removeView(eq(mUdfpsView)); } @Test public void hideUdfpsOverlay_resetsAltAuthBouncerWhenShowing() throws RemoteException { // GIVEN overlay was showing and the udfps bouncer is showing mOverlayController.showUdfpsOverlay(TEST_UDFPS_SENSOR_ID, IUdfpsOverlayController.REASON_AUTH_FPM_KEYGUARD, mUdfpsOverlayControllerCallback); when(mStatusBarKeyguardViewManager.isShowingAlternateAuth()).thenReturn(true); // WHEN the overlay is hidden mOverlayController.hideUdfpsOverlay(TEST_UDFPS_SENSOR_ID); mFgExecutor.runAllReady(); // THEN the udfps bouncer is reset verify(mStatusBarKeyguardViewManager).resetAlternateAuth(eq(true)); } @Test public void testSubscribesToOrientationChangesWhenShowingOverlay() throws Exception { mOverlayController.showUdfpsOverlay(TEST_UDFPS_SENSOR_ID, Loading