Merge "[Shell Transition] Defer remove splash screen window when it is inTransition."

This commit is contained in:
Wei Sheng Shih
2022-09-20 07:46:37 +00:00
committed by Android (Google) Code Review

View File

@@ -2755,6 +2755,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
final StartingSurfaceController.StartingSurface surface;
final WindowState startingWindow = mStartingWindow;
final boolean animate;
if (mStartingData != null) {
animate = prepareAnimation && mStartingData.needRevealAnimation()
@@ -2779,7 +2780,19 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
return;
}
surface.remove(animate);
if (animate && mTransitionController.inCollectingTransition(startingWindow)
&& startingWindow.cancelAndRedraw()) {
// 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.
startingWindow.mSyncTransaction.addTransactionCommittedListener(Runnable::run, () -> {
synchronized (mAtmService.mGlobalLock) {
surface.remove(true);
}
});
} else {
surface.remove(animate);
}
}
/**