diff options
| author | 2021-07-09 05:47:24 +0000 | |
|---|---|---|
| committer | 2021-07-09 17:30:38 +0000 | |
| commit | ff3268f426dadb25bfab23d4ac337ac62b9cc8dd (patch) | |
| tree | 00392d59d19a20bd224d304b75c2ce33fcb379a8 | |
| parent | 7efc7a91719dbcccccedf48e80bf169808c5f6a2 (diff) | |
Revert "Enable orientation listener at all times."
This reverts commit 7efc7a91719dbcccccedf48e80bf169808c5f6a2.
Reason for revert: seems to causing PTS PowerTest (pts/device-presubmit-power) failure - b/193195601
Bug: 193195601
Change-Id: Ie5d25787bfff3e1f0bb7afc73ed580012eea66ae
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java index 2aa89e86d5c8..2a18055da232 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java @@ -121,15 +121,11 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } private class BiometricOrientationEventListener extends OrientationEventListener { - @Surface.Rotation private int mLastRotation = ORIENTATION_UNKNOWN; + @Surface.Rotation private int mLastRotation; BiometricOrientationEventListener(Context context) { super(context); - - final Display display = context.getDisplay(); - if (display != null) { - mLastRotation = display.getRotation(); - } + mLastRotation = context.getDisplay().getRotation(); } @Override @@ -204,6 +200,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, Log.w(TAG, "ACTION_CLOSE_SYSTEM_DIALOGS received"); mCurrentDialog.dismissWithoutCallback(true /* animate */); mCurrentDialog = null; + mOrientationListener.disable(); try { if (mReceiver != null) { @@ -232,6 +229,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, Log.w(TAG, "Evicting client due to: " + topPackage); mCurrentDialog.dismissWithoutCallback(true /* animate */); mCurrentDialog = null; + mOrientationListener.disable(); if (mReceiver != null) { mReceiver.onDialogDismissed( @@ -471,7 +469,6 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, mSidefpsControllerFactory = sidefpsControllerFactory; mWindowManager = windowManager; mOrientationListener = new BiometricOrientationEventListener(context); - mOrientationListener.enable(); mFaceProps = mFaceManager != null ? mFaceManager.getSensorPropertiesInternal() : null; @@ -666,6 +663,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, // BiometricService will have already sent the callback to the client in this case. // This avoids a round trip to SystemUI. So, just dismiss the dialog and we're done. mCurrentDialog = null; + mOrientationListener.disable(); } /** @@ -737,6 +735,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, mReceiver = (IBiometricSysuiReceiver) args.arg2; mCurrentDialog = newDialog; mCurrentDialog.show(mWindowManager, savedState); + mOrientationListener.enable(); } private void onDialogDismissed(@DismissedReason int reason) { @@ -746,6 +745,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } mReceiver = null; mCurrentDialog = null; + mOrientationListener.disable(); } @Override @@ -758,6 +758,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, mCurrentDialog.onSaveState(savedState); mCurrentDialog.dismissWithoutCallback(false /* animate */); mCurrentDialog = null; + mOrientationListener.disable(); // Only show the dialog if necessary. If it was animating out, the dialog is supposed // to send its pending callback immediately. |