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
This commit is contained in:
wilsonshih
2021-10-06 20:12:40 +08:00
committed by Wei Sheng Shih
parent e921c7a282
commit 34628833ad

View File

@@ -6034,7 +6034,8 @@ class WindowState extends WindowContainer<WindowState> 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;