From 08bc4ed31ba602c26bc7ebc6db3e28cd7f562555 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 26 May 2020 18:32:18 +0800 Subject: [PATCH] Do not force seamless rotation with animating rotated recents The animating recents activity (e.g. home) is set as fixed-rotation- launching-app to reduce extra enable/disable transform because it may be the real top activity later (e.g. swipe to home or enter overview). The actual state is only known when finishing the recents animation. So during animating, it is not really the top activity that will change the rotation of display. If auto-rotate is disabled, there will have a rotation button when device is rotated. And if the device is using gesture navigation, the touch region of button may overlap with the navigation bar. Then when pressing the button while device is in landscape, the recents activity may also be triggered with fixed rotation in portrait, that causes the rotation type is forced to be seamless. But the actual foreground app is not rotated and does not declare to use seamless, therefore the screen looks flickering by updating configuration directly. Fixes: 157208761 Test: DisplayContentTests#testRotateSeamlesslyWithFixedRotation Change-Id: If512ad14420ed7956fe888a0ce9f5d5006eb43a8 --- .../com/android/server/wm/DisplayContent.java | 12 ++++++++++-- .../com/android/server/wm/DisplayRotation.java | 2 +- .../android/server/wm/ActivityRecordTests.java | 6 +++--- .../android/server/wm/DisplayContentTests.java | 18 ++++++++++++++++++ .../wm/RecentsAnimationControllerTest.java | 10 +++++----- 5 files changed, 37 insertions(+), 11 deletions(-) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index ad1ee1cc28430..c0a991ccdc79b 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -1485,8 +1485,16 @@ class DisplayContent extends WindowContainer