[Shell Transition] Defer remove splash screen window when it is

inTransition.

If splash screen window was in transition, the client side is unable
to draw because of Session#cancelDraw, which can also blocking the
reveal animation. But since the client side may alreday report draw
finish after prepareSync, defer the remove starting window signal
after the start transaction applied.

Bug: 246518648
Test: repeat run atest testConvertTranslucentOnTranslucentActivity
Change-Id: Ia6a555b5657f531dfed1d2f97e23302f7cd584a2
This commit is contained in:
wilsonshih
2022-09-15 17:25:02 +08:00
parent 376a24534b
commit aa82677f8c

View File

@@ -2746,6 +2746,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()
@@ -2770,7 +2771,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);
}
}
/**