Consolidate adjacent launch while having a background split pair
Launch with launch_adjacent flag will launch the activity to the
adjacent side of the source task and any of the following trampoline
launches should be launched into the same side of its source task. Even
if the trampoline launch reusing one of the splitting tasks in the
background. This makes sure to evicts old child tasks to prevent
interfering with the new split pair.
Bug: 279720005
Test: atest WMShellUnitTests WMShellFlickerTests
Test: having Chrome in a background split pair, click a link on
Messages, it composes Chrome - Messages pair properly no matter
what stage Chrome was placed in the background.
Change-Id: I6a8d0cd0000dd13ffdb21a27c927aec03151aabf
This commit is contained in:
@@ -1478,6 +1478,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
}
|
}
|
||||||
// If running background, we need to reparent current top visible task to main stage.
|
// If running background, we need to reparent current top visible task to main stage.
|
||||||
if (!isSplitScreenVisible()) {
|
if (!isSplitScreenVisible()) {
|
||||||
|
// Ensure to evict old splitting tasks because the new split pair might be composed by
|
||||||
|
// one of the splitting tasks, evicting the task when finishing entering transition
|
||||||
|
// won't guarantee to put the task to the indicated new position.
|
||||||
|
mMainStage.evictAllChildren(wct);
|
||||||
mMainStage.reparentTopTask(wct);
|
mMainStage.reparentTopTask(wct);
|
||||||
prepareSplitLayout(wct);
|
prepareSplitLayout(wct);
|
||||||
}
|
}
|
||||||
@@ -2307,8 +2311,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
mSplitTransitions.setDismissTransition(transition, dismissTop,
|
mSplitTransitions.setDismissTransition(transition, dismissTop,
|
||||||
EXIT_REASON_APP_FINISHED);
|
EXIT_REASON_APP_FINISHED);
|
||||||
} else if (!isSplitScreenVisible() && isOpening) {
|
} else if (!isSplitScreenVisible() && isOpening) {
|
||||||
// If split running backgroud and trigger task is appearing into split,
|
// If split is running in the background and the trigger task is appearing into
|
||||||
// prepare to enter split screen.
|
// split, prepare to enter split screen.
|
||||||
|
setSideStagePosition(SPLIT_POSITION_BOTTOM_OR_RIGHT, out);
|
||||||
prepareEnterSplitScreen(out);
|
prepareEnterSplitScreen(out);
|
||||||
mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(),
|
mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(),
|
||||||
TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering);
|
TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering);
|
||||||
@@ -2334,6 +2339,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
if (isOpening && getStageOfTask(triggerTask) != null) {
|
if (isOpening && getStageOfTask(triggerTask) != null) {
|
||||||
// One task is appearing into split, prepare to enter split screen.
|
// One task is appearing into split, prepare to enter split screen.
|
||||||
out = new WindowContainerTransaction();
|
out = new WindowContainerTransaction();
|
||||||
|
setSideStagePosition(SPLIT_POSITION_BOTTOM_OR_RIGHT, out);
|
||||||
prepareEnterSplitScreen(out);
|
prepareEnterSplitScreen(out);
|
||||||
mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(),
|
mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(),
|
||||||
TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering);
|
TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering);
|
||||||
|
|||||||
Reference in New Issue
Block a user