From 3ae8aab87f8646908173b12de2eadc2dc6e266b1 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 16 Jun 2020 18:56:17 +0800 Subject: [PATCH] Finish fixed rotation while the task has done transition Assume an activity A is started in portrait and it starts another landscape activity B immediately in the same task. If fixed rotation applies for this case, the starting window will transfer across different orientations that may look flickering. And because the transformed activity is the B, the transition finished event of A cannot match B that causes the display stays in old orientation. This change makes the case use normal rotation animation to avoid the flickering, and still handles the case that the transition is done but the notified record is the first activity to avoid other similar cases to miss the orientation update. Fixes: 158112625 Test: DisplayContentTests#testFinishFixedRotationNoAppTransitioningTask Change-Id: I559b0881463e379c17e35b7cfd96948feb36bf4b --- .../com/android/server/wm/DisplayContent.java | 39 ++++++++++++++----- .../server/wm/DisplayContentTests.java | 25 +++++++++++- 2 files changed, 53 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 fb602573e31b2..ea574d5908ff4 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -1463,9 +1463,10 @@ class DisplayContent extends WindowContainer