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
This commit is contained in:
Riddle Hsu
2021-11-24 17:22:52 +08:00
parent a93b661b8c
commit 3549a251fc

View File

@@ -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) {