Execute transition by starting window only if it is forward type

Otherwise if the onStartingWindowDrawn is called for a transferred
starting window, it may be too early to execute the close transition
which is triggered by previous finishing trampoline activity.

Bug: 206513982
Test: setprop persist.debug.shell_transit 1; reboot
      atest StartActivityTests#testStartActivityFromFinishingActivity
Change-Id: I4ff020384092b2c95ca9038a9a3fcb7515f398d5
This commit is contained in:
Riddle Hsu
2021-11-17 19:07:07 +08:00
parent 07d5ae6a67
commit 3b61847cf2

View File

@@ -5971,10 +5971,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// because it may be a trampoline.
if (!wasTaskVisible && mStartingData != null && !finishing && !mLaunchedFromBubble
&& !mDisplayContent.mAppTransition.isReady()
&& !mDisplayContent.mAppTransition.isRunning()) {
&& !mDisplayContent.mAppTransition.isRunning()
&& mDisplayContent.isNextTransitionForward()) {
// The pending transition state will be cleared after the transition is started, so
// save the state for launching the client later (used by LaunchActivityItem).
mStartingData.mIsTransitionForward = mDisplayContent.isNextTransitionForward();
mStartingData.mIsTransitionForward = true;
mDisplayContent.executeAppTransition();
}
}