From 34628833adcd08c376c1e139d9a3290fd23e3ef1 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Wed, 6 Oct 2021 20:12:40 +0800 Subject: [PATCH] WindowState isSyncFinished should also check isVisibleRequested WS#isSyncFinished could pass too early when the visibility is gone, which make nothing draw on the ActivityRecord. There should also check isVisibleRequested for that condition. Bug: 199363064 Test: enable shell transition, quick switch app several times and verify no flicker happen. Change-Id: Ia4af7c989159d7f0612a78bfe13853d50955beed --- services/core/java/com/android/server/wm/WindowState.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 5f9d4f5182bc4..227999171ab51 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -6034,7 +6034,8 @@ class WindowState extends WindowContainer implements WindowManagerP @Override boolean isSyncFinished() { - if (mSyncState == SYNC_STATE_WAITING_FOR_DRAW && mViewVisibility == View.GONE) { + if (mSyncState == SYNC_STATE_WAITING_FOR_DRAW && mViewVisibility == View.GONE + && !isVisibleRequested()) { // Don't wait for GONE windows. However, we don't alter the state in case the window // becomes un-gone while the syncset is still active. return true;