From 906c8f0fa5e4403c05686249f4a7ff272dd19190 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 14 Feb 2023 00:53:17 +0800 Subject: [PATCH] Set display change ready only if no one sets Otherwise it will break some cases explicitly set ready to false, such as if there is activity switch. Bug: 268506437 Test: atest NexusLauncherTests:TaplTestsLauncher3 Test: Simulate the sequence: setRequestedOrientation() -> finishActivity() -> startTransition(). The task surface should be visible. Change-Id: Ie76092420a9285401818fd96fe36971e2890cb3d --- services/core/java/com/android/server/wm/Transition.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java index d23b9540f451b..c314c387605c1 100644 --- a/services/core/java/com/android/server/wm/Transition.java +++ b/services/core/java/com/android/server/wm/Transition.java @@ -2019,7 +2019,13 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { final DisplayContent dc = wc.asDisplayContent(); if (dc == null || !mChanges.get(dc).hasChanged()) continue; dc.sendNewConfiguration(); - setReady(dc, true); + // Set to ready if no other change controls the ready state. But if there is, such as + // if an activity is pausing, it will call setReady(ar, false) and wait for the next + // resumed activity. Then do not set to ready because the transition only contains + // partial participants. Otherwise the transition may only handle HIDE and miss OPEN. + if (!mReadyTracker.mUsed) { + setReady(dc, true); + } } }