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

Commit 1ebcd8e4 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Removed mStackId (86/n)

mStackId is the same as mTaskId since all stacks are now tasks
Also, switch some of the users to use getRootTask()/getRootTaskId()
where it makes sense.

Bug: 80414790
Test: Existing tests pass.
Change-Id: Ie625bf8734ca01646f6f45705edf0eb240819c24
parent c17e5cf0
Loading
Loading
Loading
Loading
+34 −37
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import static android.app.ActivityOptions.ANIM_THUMBNAIL_ASPECT_SCALE_UP;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_UP;
import static android.app.ActivityOptions.ANIM_UNDEFINED;
import static android.app.ActivityTaskManager.INVALID_STACK_ID;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.AppOpsManager.MODE_ALLOWED;
import static android.app.AppOpsManager.OP_PICTURE_IN_PICTURE;
@@ -1426,7 +1425,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                return null;
            }
            ActivityRecord r = token.weakActivity.get();
            if (r == null || r.getActivityStack() == null) {
            if (r == null || r.getRootTask() == null) {
                return null;
            }
            return r;
@@ -2055,19 +2054,17 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
    }

    /**
     * @return Stack value from current task, null if there is no task.
     */
    ActivityStack getActivityStack() {
        return task != null ? task.getStack() : null;
    /** @return Root task of this activity, null if there is no task. */
    ActivityStack getRootTask() {
        return task != null ? (ActivityStack) task.getRootTask() : null;
    }

    int getStackId() {
        return getActivityStack() != null ? getActivityStack().mStackId : INVALID_STACK_ID;
    int getRootTaskId() {
        return task != null ? task.getRootTaskId() : INVALID_TASK_ID;
    }

    DisplayContent getDisplay() {
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        return stack != null ? stack.getDisplay() : null;
    }

@@ -2088,7 +2085,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        mWmService.mWindowPlacerLocked.requestTraversal();

        if (changed && task != null && !occludesParent) {
            getActivityStack().convertActivityToTranslucent(this);
            getRootTask().convertActivityToTranslucent(this);
        }
        // Always ensure visibility if this activity doesn't occlude parent, so the
        // {@link #returningOptions} of the activity under this one can be applied in
@@ -2123,7 +2120,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    }

    boolean isInStackLocked() {
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        return stack != null && stack.isInStackLocked(this) != null;
    }

@@ -2325,7 +2322,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            return false;
        }

        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (stack == null) {
            Slog.w(TAG, "moveActivityStackToFront: invalid task or stack: activity="
                    + this + " task=" + task);
@@ -2456,7 +2453,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            return FINISH_RESULT_CANCELLED;
        }

        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        final boolean mayAdjustTop = (isState(RESUMED) || stack.mResumedActivity == null)
                && stack.isFocusedStackOnDisplay();
        final boolean shouldAdjustGlobalFocus = mayAdjustTop
@@ -2497,7 +2494,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                    final DisplayContent display = stack.getDisplay();
                    next = display.topRunningActivity();
                    if (next != null) {
                        display.positionStackAtTop(next.getActivityStack(),
                        display.positionStackAtTop(next.getRootTask(),
                                false /* includingParents */, "finish-display-top");
                    }
                }
@@ -2666,7 +2663,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        mStackSupervisor.mStoppingActivities.remove(this);
        mStackSupervisor.mGoingToSleepActivities.remove(this);

        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        final DisplayContent display = getDisplay();
        // TODO(b/137329632): Exclude current activity when looking for the next one with
        // DisplayContent#topRunningActivity().
@@ -2824,7 +2821,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    boolean safelyDestroy(String reason) {
        if (isDestroyable()) {
            if (DEBUG_SWITCH) {
                final ActivityStack stack = getActivityStack();
                final ActivityStack stack = getRootTask();
                Slog.v(TAG_SWITCH, "Safely destroying " + this + " in state " + getState()
                        + " resumed=" + stack.mResumedActivity
                        + " pausing=" + stack.mPausingActivity
@@ -3612,7 +3609,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    }

    final boolean isSleeping() {
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        return stack != null ? stack.shouldSleepActivities() : mAtmService.isSleepingLocked();
    }

@@ -4449,7 +4446,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            return visibleIgnoringKeyguard;
        }

        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (stack == null) {
            return false;
        }
@@ -4471,7 +4468,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    }

    boolean shouldBeVisible() {
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (stack == null) {
            return false;
        }
@@ -4492,7 +4489,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // If this activity is paused, tell it to now show its window.
        if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY,
                "Making visible and scheduling visibility: " + this);
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        try {
            if (stack.mTranslucentActivityWaiting != null) {
                updateOptionsLocked(returningOptions);
@@ -4578,7 +4575,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            if (DEBUG_VISIBILITY) {
                Slog.v(TAG_VISIBILITY, "Resume visible activity, " + this);
            }
            return getActivityStack().resumeTopActivityUncheckedLocked(activeActivity /* prev */,
            return getRootTask().resumeTopActivityUncheckedLocked(activeActivity /* prev */,
                    null /* options */);
        } else if (shouldPauseActivity(activeActivity)) {
            if (DEBUG_VISIBILITY) {
@@ -4643,7 +4640,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     */
    private boolean shouldBeResumed(ActivityRecord activeActivity) {
        return shouldMakeActive(activeActivity) && isFocusable()
                && getActivityStack().getVisibility(activeActivity) == STACK_VISIBILITY_VISIBLE
                && getRootTask().getVisibility(activeActivity) == STACK_VISIBILITY_VISIBLE
                && canResumeByCompat();
    }

@@ -4672,7 +4669,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // ActivityStack#ensureActivitiesVisible will bring the activity to a proper
        // active state.
        if (!isState(STARTED, RESUMED, PAUSED, STOPPED, STOPPING)
                || getActivityStack().mTranslucentActivityWaiting != null) {
                || getRootTask().mTranslucentActivityWaiting != null) {
            return false;
        }

@@ -4769,7 +4766,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        mStackSupervisor.reportResumedActivityLocked(this);

        resumeKeyDispatchingLocked();
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        mStackSupervisor.mNoAnimActivities.clear();

        // Mark the point when the activity is resuming
@@ -4862,7 +4859,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    void stopIfPossible() {
        if (DEBUG_SWITCH) Slog.d(TAG_SWITCH, "Stopping: " + this);
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (isNoHistory()) {
            if (!finishing) {
                if (!stack.shouldSleepActivities()) {
@@ -4919,7 +4916,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    void activityStopped(Bundle newIcicle, PersistableBundle newPersistentState,
            CharSequence description) {
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        final boolean isStopping = mState == STOPPING;
        if (!isStopping && mState != RESTARTING_PROCESS) {
            Slog.i(TAG, "Activity reported stop, but no longer stopping: " + this);
@@ -4969,7 +4966,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            mStackSupervisor.mStoppingActivities.add(this);
        }

        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        // If we already have a few activities waiting to stop, then give up on things going idle
        // and start clearing them out. Or if r is the last of activity of the last task the stack
        // will be empty and must be cleared immediately.
@@ -5005,7 +5002,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            return false;
        }

        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (stack == null) {
            return false;
        }
@@ -5021,7 +5018,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    void finishLaunchTickingLocked() {
        launchTickTime = 0;
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (stack == null) {
            return;
        }
@@ -5491,13 +5488,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    static ActivityRecord isInStackLocked(IBinder token) {
        final ActivityRecord r = ActivityRecord.forTokenLocked(token);
        return (r != null) ? r.getActivityStack().isInStackLocked(r) : null;
        return (r != null) ? r.getRootTask().isInStackLocked(r) : null;
    }

    static ActivityStack getStackLocked(IBinder token) {
        final ActivityRecord r = ActivityRecord.isInStackLocked(token);
        if (r != null) {
            return r.getActivityStack();
            return r.getRootTask();
        }
        return null;
    }
@@ -5507,7 +5504,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     *         {@link android.view.Display#INVALID_DISPLAY} if not attached.
     */
    int getDisplayId() {
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (stack == null) {
            return INVALID_DISPLAY;
        }
@@ -5519,7 +5516,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            // This would be redundant.
            return false;
        }
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (isState(RESUMED) || stack == null || this == stack.mPausingActivity || !mHaveState
                || !stopped) {
            // We're not ready for this kind of thing.
@@ -6755,7 +6752,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    private void applyAspectRatio(Rect outBounds, Rect containingAppBounds,
            Rect containingBounds) {
        final float maxAspectRatio = info.maxAspectRatio;
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        final float minAspectRatio = info.minAspectRatio;

        if (task == null || stack == null || (inMultiWindowMode() && !shouldUseSizeCompatMode())
@@ -6861,7 +6858,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     */
    boolean ensureActivityConfiguration(int globalChanges, boolean preserveWindow,
            boolean ignoreVisibility) {
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        if (stack.mConfigWillChange) {
            if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION,
                    "Skipping config check (will change): " + this);
@@ -7406,7 +7403,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (!getTurnScreenOnFlag()) {
            return false;
        }
        final ActivityStack stack = getActivityStack();
        final ActivityStack stack = getRootTask();
        return stack != null &&
                stack.checkKeyguardVisibility(this, true /* shouldBeVisible */, true /* isTop */);
    }
+10 −22
Original line number Diff line number Diff line
@@ -277,9 +277,6 @@ class ActivityStack extends Task implements BoundsAnimationTarget {

    int mCurrentUser;

    /** Unique identifier */
    final int mStackId;

    /** For comparison with DisplayContent bounds. */
    private Rect mTmpRect = new Rect();
    private Rect mTmpRect2 = new Rect();
@@ -633,7 +630,6 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
                _realActivitySuspended, userSetupComplete, minWidth, minHeight, info, _voiceSession,
                _voiceInteractor, stack);

        mStackId = mTaskId;
        mDockedStackMinimizeThickness = mWmService.mContext.getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.docked_stack_minimize_thickness);
        EventLogTags.writeWmStackCreated(id);
@@ -1118,7 +1114,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
            return null;
        }
        final Task task = r.getTask();
        final ActivityStack stack = r.getActivityStack();
        final ActivityStack stack = r.getRootTask();
        if (stack != null && task.mChildren.contains(r) && mChildren.contains(task)) {
            if (stack != this) Slog.w(TAG,
                    "Illegal state! task does not point to stack it is in.");
@@ -1347,7 +1343,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {

    private boolean containsActivityFromStack(List<ActivityRecord> rs) {
        for (ActivityRecord r : rs) {
            if (r.getActivityStack() == this) {
            if (r.getRootTask() == this) {
                return true;
            }
        }
@@ -1873,7 +1869,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
        final DisplayContent displayContent = getDisplay();
        if (displayContent == null) {
            throw new IllegalStateException("Stack is not attached to any display, stackId="
                    + mStackId);
                    + getRootTaskId());
        }

        final int flags = displayContent.mDisplay.getFlags();
@@ -2592,7 +2588,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
            return false;
        }
        final ActivityStack targetStack = toFrontTask != null
                ? toFrontTask.getStack() : toFrontActivity.getActivityStack();
                ? toFrontTask.getStack() : toFrontActivity.getRootTask();
        if (targetStack != null && targetStack.isActivityTypeAssistant()) {
            // Ensure the task/activity being brought forward is not the assistant
            return false;
@@ -3073,7 +3069,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
        }

        ActivityRecord topActivity = getDisplay().topRunningActivity();
        ActivityStack topStack = topActivity.getActivityStack();
        ActivityStack topStack = topActivity.getRootTask();
        if (topStack != null && topStack != this && topActivity.isState(RESUMED)) {
            // The new top activity is already resumed, so there's a good chance that nothing will
            // get resumed below. So, update visibility now in case the transition is closed
@@ -3102,7 +3098,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
            return;
        }

        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "stack.resize_" + mStackId);
        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "stack.resize_" + getRootTaskId());
        mAtmService.deferWindowLayout();
        try {
            // Update override configurations of all tasks in the stack.
@@ -3219,7 +3215,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {

    boolean dump(FileDescriptor fd, PrintWriter pw, boolean dumpAll, boolean dumpClient,
            String dumpPackage, boolean needSep) {
        pw.println("  Stack #" + mStackId
        pw.println("  Stack #" + getRootTaskId()
                + ": type=" + activityTypeToString(getActivityType())
                + " mode=" + windowingModeToString(getWindowingMode()));
        pw.println("  isSleeping=" + shouldSleepActivities());
@@ -4484,7 +4480,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {

    @Override
    void dump(PrintWriter pw, String prefix, boolean dumpAll) {
        pw.println(prefix + "mStackId=" + mStackId);
        pw.println(prefix + "mStackId=" + getRootTaskId());
        pw.println(prefix + "mDeferRemoval=" + mDeferRemoval);
        pw.println(prefix + "mBounds=" + getRawBounds().toShortString());
        if (mMinimizeAmount != 0f) {
@@ -4515,14 +4511,6 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
        mAnimatingActivityRegistry.dump(pw, "AnimatingApps:", prefix);
    }

    String getName() {
        return toShortString();
    }

    public String toShortString() {
        return "Stack=" + mStackId;
    }

    /**
     * For docked workspace (or workspace that's side-by-side to the docked), provides
     * information which side of the screen was the dock anchored.
@@ -4863,7 +4851,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {
            @WindowTraceLogLevel int logLevel) {
        final long token = proto.start(fieldId);
        dumpDebugInnerStackOnly(proto, STACK, logLevel);
        proto.write(com.android.server.am.ActivityStackProto.ID, mStackId);
        proto.write(com.android.server.am.ActivityStackProto.ID, getRootTaskId());

        forAllTasks((t) -> {
            t.dumpDebugInner(proto, com.android.server.am.ActivityStackProto.TASKS, logLevel);
@@ -4891,7 +4879,7 @@ class ActivityStack extends Task implements BoundsAnimationTarget {

        final long token = proto.start(fieldId);
        super.dumpDebug(proto, WINDOW_CONTAINER, logLevel);
        proto.write(StackProto.ID, mStackId);
        proto.write(StackProto.ID, getRootTaskId());
        forAllTasks((t) -> {
            t.dumpDebugInnerTaskOnly(proto, StackProto.TASKS, logLevel);
        }, true /* traverseTopToBottom */, this);
+9 −9
Original line number Diff line number Diff line
@@ -824,7 +824,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
                        false /* markFrozenIfConfigChanged */, true /* deferResume */);
            }

            if (r.getActivityStack().checkKeyguardVisibility(r, true /* shouldBeVisible */,
            if (r.getRootTask().checkKeyguardVisibility(r, true /* shouldBeVisible */,
                    true /* isTop */) && r.allowMoveToFront()) {
                // We only set the visibility to true if the activity is not being launched in
                // background, and is allowed to be visible based on keyguard state. This avoids
@@ -1891,13 +1891,13 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
    // TODO: Look into changing users to this method to DisplayContent.resolveWindowingMode()
    ActivityStack getReparentTargetStack(Task task, ActivityStack stack, boolean toTop) {
        final ActivityStack prevStack = task.getStack();
        final int stackId = stack.mStackId;
        final int rootTaskId = stack.mTaskId;
        final boolean inMultiWindowMode = stack.inMultiWindowMode();

        // Check that we aren't reparenting to the same stack that the task is already in
        if (prevStack != null && prevStack.mStackId == stackId) {
        if (prevStack != null && prevStack.mTaskId == rootTaskId) {
            Slog.w(TAG, "Can not reparent to same stack, task=" + task
                    + " already in stackId=" + stackId);
                    + " already in stackId=" + rootTaskId);
            return prevStack;
        }

@@ -1912,7 +1912,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        // multi-display.
        if (stack.getDisplayId() != DEFAULT_DISPLAY && !mService.mSupportsMultiDisplay) {
            throw new IllegalArgumentException("Device doesn't support multi-display, can not"
                    + " reparent task=" + task + " to stackId=" + stackId);
                    + " reparent task=" + task + " to stackId=" + rootTaskId);
        }

        // Ensure that we aren't trying to move into a freeform stack without freeform support
@@ -1993,7 +1993,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {

    void activitySleptLocked(ActivityRecord r) {
        mGoingToSleepActivities.remove(r);
        final ActivityStack s = r.getActivityStack();
        final ActivityStack s = r.getRootTask();
        if (s != null) {
            s.checkReadyForSleep();
        } else {
@@ -2029,7 +2029,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        // A resumed activity cannot be stopping. remove from list
        mStoppingActivities.remove(r);

        final ActivityStack stack = r.getActivityStack();
        final ActivityStack stack = r.getRootTask();
        if (stack.getDisplay().allResumedActivitiesComplete()) {
            mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
            // Make sure activity & window visibility should be identical
@@ -2082,7 +2082,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
            if (DEBUG_STATES) Slog.v(TAG, "Stopping " + s + ": nowVisible=" + s.nowVisible
                    + " animating=" + animating + " finishing=" + s.finishing);

            final ActivityStack stack = s.getActivityStack();
            final ActivityStack stack = s.getRootTask();
            final boolean shouldSleepOrShutDown = stack != null
                    ? stack.shouldSleepOrShutDownActivities()
                    : mService.isSleepingOrShuttingDownLocked();
@@ -2473,7 +2473,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        final ActivityRecord r = ActivityRecord.isInStackLocked(token);
        if (r != null) {
            r.finishRelaunching();
            if (r.getActivityStack().shouldSleepOrShutDownActivities()) {
            if (r.getRootTask().shouldSleepOrShutDownActivities()) {
                r.setSleeping(true, true);
            }
        }
+10 −9
Original line number Diff line number Diff line
@@ -937,7 +937,7 @@ class ActivityStarter {
        }

        final ActivityStack resultStack = resultRecord == null
                ? null : resultRecord.getActivityStack();
                ? null : resultRecord.getRootTask();

        if (err != START_SUCCESS) {
            if (resultRecord != null) {
@@ -1425,7 +1425,7 @@ class ActivityStarter {
     * @return the stack where the successful started activity resides.
     */
    private @Nullable ActivityStack handleStartResult(@NonNull ActivityRecord started, int result) {
        final ActivityStack currentStack = started.getActivityStack();
        final ActivityStack currentStack = started.getRootTask();
        ActivityStack startedActivityStack = currentStack != null ? currentStack : mTargetStack;

        if (ActivityManager.isStartResultSuccessful(result)) {
@@ -1446,7 +1446,7 @@ class ActivityStarter {
        // If we are not able to proceed, disassociate the activity from the task. Leaving an
        // activity in an incomplete state can lead to issues, such as performing operations
        // without a window container.
        final ActivityStack stack = mStartActivity.getActivityStack();
        final ActivityStack stack = mStartActivity.getRootTask();
        if (stack != null) {
            mStartActivity.finishIfPossible("startActivity", true /* oomAdj */);
        }
@@ -2231,7 +2231,7 @@ class ActivityStarter {
            return;
        }
        if (!mSourceRecord.finishing) {
            mSourceStack = mSourceRecord.getActivityStack();
            mSourceStack = mSourceRecord.getRootTask();
            return;
        }

@@ -2314,7 +2314,7 @@ class ActivityStarter {
     * @return {@link ActivityRecord} brought to front.
     */
    private void setTargetStackIfNeeded(ActivityRecord intentActivity) {
        mTargetStack = intentActivity.getActivityStack();
        mTargetStack = intentActivity.getRootTask();
        mTargetStack.mLastPausedActivity = null;
        // If the target task is not in the front, then we need to bring it to the front...
        // except...  well, with SINGLE_TASK_LAUNCH it's not entirely clear. We'd like to have
@@ -2371,7 +2371,7 @@ class ActivityStarter {
        }
        // Need to update mTargetStack because if task was moved out of it, the original stack may
        // be destroyed.
        mTargetStack = intentActivity.getActivityStack();
        mTargetStack = intentActivity.getRootTask();
        mSupervisor.handleNonResizableTaskIfNeeded(intentActivity.getTask(),
                WINDOWING_MODE_UNDEFINED, DEFAULT_DISPLAY, mTargetStack);
    }
@@ -2422,10 +2422,11 @@ class ActivityStarter {
            return;
        }

        final ActivityStack stack = task.getStack();
        if (stack != null && stack.inPinnedWindowingMode()) {
            mService.animateResizePinnedStack(stack.mStackId, bounds, -1);
        final Task rootTask = task.getRootTask();
        if (rootTask != null && rootTask.inPinnedWindowingMode()) {
            mService.animateResizePinnedStack(rootTask.mTaskId, bounds, -1);
        } else {
            // TODO: I don't believe it is possible to reach this else condition anymore...
            task.setBounds(bounds);
        }
    }
+16 −16

File changed.

Preview size limit exceeded, changes collapsed.

Loading