From fbb265650b9a8c5ee73c5f70379951da7a226d7e Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Thu, 28 Jul 2022 20:10:24 +0800 Subject: [PATCH] Avoid collect window token which should be rotate independently Previous in c0694d4 we will preventing to do BLASTSync by check from WindowToken#prepareSync, but those window can still be ask to sync if the window was collect and another perform surface placement happen after configuration change, for the continuous rotation test those window can cause ANR on waiting for buffer. So instead of checking from prepareSync, we can just ignore them when collect. Bug: 209920544 Test: enable shell transition, run atest AppConfigurationTests Test: atest TransitionTests#testDisplayRotationChange Change-Id: If65b77bc25338489ba5f7d07119e0ef67ab79566 --- .../core/java/com/android/server/wm/TransitionController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/TransitionController.java b/services/core/java/com/android/server/wm/TransitionController.java index a02be25bc8d2d..6f4794ca86872 100644 --- a/services/core/java/com/android/server/wm/TransitionController.java +++ b/services/core/java/com/android/server/wm/TransitionController.java @@ -473,9 +473,10 @@ class TransitionController { // Collect all visible non-app windows which need to be drawn before the animation starts. final DisplayContent dc = wc.asDisplayContent(); if (dc != null) { + final boolean noAsyncRotation = dc.getAsyncRotationController() == null; wc.forAllWindows(w -> { if (w.mActivityRecord == null && w.isVisible() && !isCollecting(w.mToken) - && dc.shouldSyncRotationChange(w)) { + && (noAsyncRotation || !AsyncRotationController.canBeAsync(w.mToken))) { transition.collect(w.mToken); } }, true /* traverseTopToBottom */);