From 0d0e74ad90b0fc6867a174c9ee183fa8de3e1d48 Mon Sep 17 00:00:00 2001 From: Beverly Date: Tue, 13 Jul 2021 09:05:22 -0400 Subject: [PATCH] Always show fp icon in portrait on keyguard Never adjust the layout parameters for rotations on the keyguard. The keyguard is always in portrait mode and the orientation updates sometimes come late when the device is in auto-rotate mode. Test: manual Fixes: 193315242 Change-Id: I654cf2156a7f02a8e74867bbc225eaabf8c5efda --- .../com/android/systemui/biometrics/UdfpsController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java index 0686406222941..e51baed065ef6 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java @@ -636,9 +636,12 @@ public class UdfpsController implements DozeReceiver { // Gets the size based on the current rotation of the display. mContext.getDisplay().getRealSize(p); - // Transform dimensions if the device is in landscape mode. + // Transform dimensions if the device is in landscape mode switch (mContext.getDisplay().getRotation()) { case Surface.ROTATION_90: + if (animation instanceof UdfpsKeyguardViewController) { + break; + } mCoreLayoutParams.x = mSensorProps.sensorLocationY - mSensorProps.sensorRadius - paddingX; mCoreLayoutParams.y = p.y - mSensorProps.sensorLocationX - mSensorProps.sensorRadius @@ -646,6 +649,9 @@ public class UdfpsController implements DozeReceiver { break; case Surface.ROTATION_270: + if (animation instanceof UdfpsKeyguardViewController) { + break; + } mCoreLayoutParams.x = p.x - mSensorProps.sensorLocationY - mSensorProps.sensorRadius - paddingX; mCoreLayoutParams.y = mSensorProps.sensorLocationX - mSensorProps.sensorRadius @@ -654,6 +660,7 @@ public class UdfpsController implements DozeReceiver { default: // Do nothing to stay in portrait mode. + // Keyguard is always in portrait mode. } // avoid announcing window title mCoreLayoutParams.accessibilityTitle = " ";