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

Commit 289b7569 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Move task focusing activity task to the front when we focus on the stack"

parents 38b45207 eae451e5
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -478,7 +478,15 @@ final class ActivityStack {
                mActivityContainer.mActivityDisplay.mDisplayId == Display.DEFAULT_DISPLAY;
    }

    final void moveToFront(String reason) {
    void moveToFront(String reason) {
        moveToFront(reason, null);
    }

    /**
     * @param reason The reason for moving the stack to the front.
     * @param task If non-null, the task will be moved to the top of the stack.
     * */
    void moveToFront(String reason, TaskRecord task) {
        if (isAttached()) {
            final boolean homeStack = isHomeStack()
                    || (mActivityContainer.mParentActivity != null
@@ -496,7 +504,11 @@ final class ActivityStack {
            if (isOnHomeDisplay()) {
                mStackSupervisor.moveHomeStack(homeStack, reason, lastFocusStack);
            }
            final TaskRecord task = topTask();
            if (task != null) {
                insertTaskAtTop(task, null);
            } else {
                task = topTask();
            }
            if (task != null) {
                mWindowManager.moveTaskToTop(task.taskId);
            }
+1 −1
Original line number Diff line number Diff line
@@ -1822,7 +1822,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
            Slog.w(TAG, "Can't set focus stack for r=" + r + " task=" + task);
            return false;
        }
        task.stack.moveToFront(reason);
        task.stack.moveToFront(reason, task);
        return true;
    }