Only bring side to top when split visible
We did some error handle on startAnimation to exit split by some
exception case. However, we should only bring side to top when
exit only when split is visible case. If split is background,
we should always do not bring side to top.
Fix: 287002454
Test: manual
Test: pass existing tests
Change-Id: Id8835408ffa1bc0e8736659956e20e819a53627a
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
index 79002bb..4efb5a5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
@@ -2488,8 +2488,9 @@
&& getStageType(dismissStages.valueAt(0)) == STAGE_TYPE_MAIN)
|| mMainStage.getChildCount() == 0 ? STAGE_TYPE_SIDE : STAGE_TYPE_MAIN;
// If there is a fullscreen opening change, we should not bring stage to top.
- prepareExitSplitScreen(record.mContainShowFullscreenChange
- ? STAGE_TYPE_UNDEFINED : dismissTop, wct);
+ prepareExitSplitScreen(
+ !record.mContainShowFullscreenChange && isSplitScreenVisible()
+ ? dismissTop : STAGE_TYPE_UNDEFINED, wct);
mSplitTransitions.startDismissTransition(wct, this, dismissTop,
EXIT_REASON_APP_FINISHED);
// This can happen in some pathological cases. For example: