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

Commit a5d64ebb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Get candidate stack for launch if possible"

parents 06716bec f3070c55
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2329,9 +2329,9 @@ class ActivityStarter {
                    intentActivity.setTaskToAffiliateWith(mSourceRecord.getTaskRecord());
                }

                final ActivityStack launchStack = getLaunchStack(
                        mStartActivity, mLaunchFlags, mStartActivity.getTaskRecord(), mOptions);
                final TaskRecord intentTask = intentActivity.getTaskRecord();
                final ActivityStack launchStack =
                        getLaunchStack(mStartActivity, mLaunchFlags, intentTask, mOptions);
                if (launchStack == null || launchStack == mTargetStack) {
                    // We only want to move to the front, if we aren't going to launch on a
                    // different stack. If we launch on a different stack, we will put the
@@ -2375,9 +2375,12 @@ class ActivityStarter {
                            REPARENT_MOVE_STACK_TO_FRONT, ANIMATE, DEFER_RESUME,
                            "reparentingHome");
                    mMovedToFront = true;
                } else if (launchStack.topTask() == null) {
                }

                if (launchStack.topTask() == null) {
                    // The task does not need to be reparented to the launch stack. Remove the
                    // launch stack if there is no activity in it.
                    Slog.w(TAG, "Removing an empty stack: " + launchStack);
                    launchStack.remove();
                }

+6 −2
Original line number Diff line number Diff line
@@ -1780,9 +1780,13 @@ class RootActivityContainer extends ConfigurationContainer
        // If {@code r} is already in target display and its task is the same as the candidate task,
        // the intention should be getting a launch stack for the reusable activity, so we can use
        // the existing stack.
        if (r.getDisplayId() == displayId && r.getTaskRecord() == candidateTask) {
        if (candidateTask != null
                && (r.getTaskRecord() == null || r.getTaskRecord() == candidateTask)) {
            final int attachedDisplayId = r.getDisplayId();
            if (attachedDisplayId == INVALID_DISPLAY || attachedDisplayId == displayId) {
                return candidateTask.getStack();
            }
        }

        int windowingMode;
        if (launchParams != null) {