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

Commit d01a4d84 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by android-build-merger
Browse files

Set correct stack before restoring tasks

am: 3c800a49

* commit '3c800a49':
  Set correct stack before restoring tasks

Change-Id: I028f1c2db130f487d83543c8285a80e7392f8cb5
parents 4f14219d 3c800a49
Loading
Loading
Loading
Loading
+20 −17
Original line number Diff line number Diff line
@@ -4356,18 +4356,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
                ? new ActivityOptions(bOptions) : null;
        final int launchStackId = (activityOptions != null)
                ? activityOptions.getLaunchStackId() : INVALID_STACK_ID;

        if (launchStackId == HOME_STACK_ID) {
            throw new IllegalArgumentException("startActivityFromRecentsInner: Task "
                    + taskId + " can't be launch in the home stack.");
        }
        task = anyTaskForIdLocked(taskId, RESTORE_FROM_RECENTS, launchStackId);
        if (task == null) {
            throw new IllegalArgumentException(
                    "startActivityFromRecentsInner: Task " + taskId + " not found.");
        }

        if (launchStackId != INVALID_STACK_ID) {
        if (launchStackId == DOCKED_STACK_ID) {
            mWindowManager.setDockedStackCreateState(
                    activityOptions.getDockCreateMode(), null /* initialBounds */);
@@ -4378,6 +4371,16 @@ public final class ActivityStackSupervisor implements DisplayListener {
            deferUpdateBounds(HOME_STACK_ID);
            mWindowManager.prepareAppTransition(TRANSIT_DOCK_TASK_FROM_RECENTS, false);
        }

        task = anyTaskForIdLocked(taskId, RESTORE_FROM_RECENTS, launchStackId);
        if (task == null) {
            continueUpdateBounds(HOME_STACK_ID);
            mWindowManager.executeAppTransition();
            throw new IllegalArgumentException(
                    "startActivityFromRecentsInner: Task " + taskId + " not found.");
        }

        if (launchStackId != INVALID_STACK_ID) {
            if (task.stack.mStackId != launchStackId) {
                moveTaskToStackLocked(
                        taskId, launchStackId, ON_TOP, FORCE_FOCUS, "startActivityFromRecents",