Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 169716d3 authored by Tony Huang's avatar Tony Huang Committed by Automerger Merge Worker
Browse files

Merge "Make new task follow source task root" into sc-v2-dev am: 8172fc3e am: e34a978e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16055327

Change-Id: I9a269cea7bd6e67188b20a10cfa021f658f02953
parents f6348277 e34a978e
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2771,9 +2771,11 @@ class ActivityStarter {
        // If it exist, we need to reparent target root task from TDA to launch root task.
        final TaskDisplayArea tda = mTargetRootTask.getDisplayArea();
        final Task launchRootTask = tda.getLaunchRootTask(mTargetRootTask.getWindowingMode(),
                mTargetRootTask.getActivityType(), null /** options */, null /** sourceTask */,
                0 /** launchFlags */);
        if (launchRootTask != null && launchRootTask != mTargetRootTask) {
                mTargetRootTask.getActivityType(), null /** options */,
                mSourceRootTask, 0 /** launchFlags */);
        // If target root task is created by organizer, let organizer handle reparent itself.
        if (!mTargetRootTask.mCreatedByOrganizer && launchRootTask != null
                && launchRootTask != mTargetRootTask) {
            mTargetRootTask.reparent(launchRootTask, POSITION_TOP);
            mTargetRootTask = launchRootTask;
        }
+5 −0
Original line number Diff line number Diff line
@@ -1209,6 +1209,11 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
                }
            }
        }
        // For better split UX, If task launch by the source task which root task is created by
        // organizer, it should also launch in that root too.
        if (sourceTask != null && sourceTask.getRootTask().mCreatedByOrganizer) {
            return sourceTask.getRootTask();
        }
        return null;
    }