Don‘t consider adjacent launch root if the existing task is't on top

The adjacent task is considered as a launch root task if an existing
task is already in the adjacent task of the launch target. This CL
updates the policy while the task is located in an adjacent task and
the existing task is on the top.

Bug: 280392203
Test: atest ActivityStarterTests
Test: split(A|B)->split(A,C|B),drag A to B’side, Result:split(C|A)
Change-Id: I006de0438c572defe4f770d29378c8ddfadc351d
This commit is contained in:
Jeff Chang
2023-05-10 08:58:16 +00:00
parent c111807c2b
commit 36f5d615f4

View File

@@ -2929,7 +2929,8 @@ class ActivityStarter {
// the adjacent task as its launch target. So the existing task will be launched into the
// closer one and won't be reparent redundantly.
final Task adjacentTargetTask = mTargetRootTask.getAdjacentTask();
if (adjacentTargetTask != null && intentActivity.isDescendantOf(adjacentTargetTask)) {
if (adjacentTargetTask != null && intentActivity.isDescendantOf(adjacentTargetTask)
&& intentTask.isOnTop()) {
mTargetRootTask = adjacentTargetTask;
}