From 3549a251fc8be8d8885f85c4d90cc8117860db19 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Wed, 24 Nov 2021 17:22:52 +0800 Subject: [PATCH] Do not skip restoring rotation lock when returning to home Since live-tile is enabled, the foreground app is still the original activity, the display rotation doesn't change by the recents app activity. So the condition added in commit 95cb52a doesn't need to be enabled. Bug: 205979005 Test: 1. Disable auto-rotation and home rotation. 2. Launch an activity in portrait. 3. Rotate the device to landscape and press rotation button. 4. Enter overview (recents). 5. Return to the application (keep in landscape). 6. Return to home and launch the app again (restore to portrait). Change-Id: Iccf87b2d66d57911cd49f2ea9080a71a85801e4c --- .../systemui/shared/rotation/RotationButtonController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButtonController.java b/packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButtonController.java index 2dbd5dee76aa6..78867f7220af0 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButtonController.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButtonController.java @@ -481,7 +481,9 @@ public class RotationButtonController { * orientation overview. */ public void setSkipOverrideUserLockPrefsOnce() { - mSkipOverrideUserLockPrefsOnce = true; + // If live-tile is enabled (recents animation keeps running in overview), there is no + // activity switch so the display rotation is not changed, then it is no need to skip. + mSkipOverrideUserLockPrefsOnce = !mIsRecentsAnimationRunning; } private boolean shouldOverrideUserLockPrefs(final int rotation) {