From e4633f88bc866232a283058d10e23c65f64ba6e5 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Thu, 6 Apr 2023 10:02:59 +0000 Subject: [PATCH] Defer remove splash screen window if it is inTransition. When another transition happen after first open app transition, e.g. create task fragment, the surface of app window may shown after transition start. If we remove starting window right after app report drawn, there might show a blank while transition is playing. Bug: 276692049 Test: manual launch app from notification shade several times, verify no blank window occur. Change-Id: If606fe2cab78143b1a80c1819088d67b6396a953 --- .../core/java/com/android/server/wm/ActivityRecord.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 8346e7c83190d..8a55db3c6c41c 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -2865,11 +2865,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return; } - if (animate && mTransitionController.inCollectingTransition(startingWindow) - && startingWindow.cancelAndRedraw()) { + if (animate && mTransitionController.inCollectingTransition(startingWindow)) { // Defer remove starting window after transition start. - // If splash screen window was in collecting, the client side is unable to draw because - // of Session#cancelDraw, which will blocking the remove animation. + // The surface of app window could really show after the transition finish. startingWindow.mSyncTransaction.addTransactionCommittedListener(Runnable::run, () -> { synchronized (mAtmService.mGlobalLock) { surface.remove(true);