From a924b839d19e8f447cb0dec0de4ca6c09e3f7bc4 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Mon, 14 Dec 2020 22:48:38 +0800 Subject: [PATCH] Clear fixed rotation if rotated recents activity becomes top If recents animation is active, the transition is controlled by it. There won't be a transition finish event after recents animation. For example, if an activity finishes during swiping-up gesture, the recents activity in rotated state won't be restored. So this change checks whether recents become the top activity, then continue the orientation update procedure to clear fixed rotation state and let display orientation follow the current top. Bug: 173143462 Test: atest RecentsAnimationControllerTest# \ testClearFixedRotationLaunchingAppAfterCleanupAnimation Change-Id: If82744bb846ac823c8fdd76bbf23b584b63776d4 (cherry picked from commit 498b87a347abb1571bc9c1cd63eb73f2808fb7e8) --- .../com/android/server/wm/DisplayContent.java | 2 +- .../wm/RecentsAnimationControllerTest.java | 35 ++++++++++++++----- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index a70e30f380f98..adf0b44040d9d 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -5728,7 +5728,7 @@ class DisplayContent extends WindowContainer