summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2023-09-20 05:13:56 +0000
committer Winson Chung <winsonc@google.com> 2023-09-21 16:50:14 +0000
commit9cd12c2a131c7cb2328f88dc8398bd1743b00672 (patch)
treee7d79665b405f105d51f8668f4febc8fb1750c1b
parent47c88876230382c2f10d11c382612d3d25340fa5 (diff)
Preemptively reset split reparenting flag when entering split
- Currently, this flag is not reset until we start the animation or when the stage visibilities officially change, but following a drop to initiate split and Shell actually receiving the transition, the app may launch a trampoline activity (ie. esp during create) which will trigger the task to be reparented back out of the split root (preventing split from succeeding). Instead we preemptively reset this state when we know that we are about to enter split, and rely on the existing paths to update the flag when the split is next fully shown or hidden. Bug: 292454704 Test: Drag app that launches a trampoline into split Change-Id: I17c8b7e92dfbf18a1bd1a9ca64b7ee7f3097f233
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java5
1 files changed, 5 insertions, 0 deletions
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 94fa485efd5c..8efdfd6ca1e1 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
@@ -1551,6 +1551,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
@Nullable ActivityManager.RunningTaskInfo taskInfo, @SplitPosition int startPosition,
boolean resizeAnim) {
onSplitScreenEnter();
+ // Preemptively reset the reparenting behavior if we know that we are entering, as starting
+ // split tasks with activity trampolines can inadvertently trigger the task to be
+ // reparented out of the split root mid-launch
+ wct.setReparentLeafTaskIfRelaunch(mRootTaskInfo.token,
+ false /* setReparentLeafTaskIfRelaunch */);
if (isSplitActive()) {
prepareBringSplit(wct, taskInfo, startPosition, resizeAnim);
} else {