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

Commit 80728d54 authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Don't try to launch-adjacent to empty task" into main

parents c2f7e140 dd34fcfa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7485,7 +7485,7 @@ public class Intent implements Parcelable, Cloneable {
    /**
     * This flag is only used for split-screen multi-window mode. The new activity will be displayed
     * adjacent to the one launching it. This can only be used in conjunction with
     * adjacent to the one launching it if possible. This can only be used in conjunction with
     * {@link #FLAG_ACTIVITY_NEW_TASK}. Also, setting {@link #FLAG_ACTIVITY_MULTIPLE_TASK} is
     * required if you want a new instance of an existing activity to be created.
     */
+5 −2
Original line number Diff line number Diff line
@@ -1079,8 +1079,11 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
        // Use launch-adjacent-flag-root if launching with launch-adjacent flag.
        if ((launchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0
                && mLaunchAdjacentFlagRootTask != null) {
            if (sourceTask != null && sourceTask == candidateTask) {
                // Do nothing when task that is getting opened is same as the source.
            if (sourceTask != null && (sourceTask == candidateTask
                    || sourceTask.topRunningActivity() == null)) {
                // Do nothing when task that is getting opened is same as the source or when
                // the source is no-longer valid.
                Slog.w(TAG_WM, "Ignoring LAUNCH_ADJACENT because adjacent source is gone.");
            } else if (sourceTask != null
                    && mLaunchAdjacentFlagRootTask.getAdjacentTask() != null
                    && (sourceTask == mLaunchAdjacentFlagRootTask
+1 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ public class TaskDisplayAreaTests extends WindowTestsBase {
        final Task adjacentRootTask = createTask(
                mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD);
        adjacentRootTask.mCreatedByOrganizer = true;
        createActivityRecord(adjacentRootTask);
        final TaskDisplayArea taskDisplayArea = rootTask.getDisplayArea();
        adjacentRootTask.setAdjacentTaskFragment(rootTask);