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

Commit 1c30cf55 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Only adjust the task position when there is no move-to-top...

Merge "Merge "Only adjust the task position when there is no move-to-top request." into rvc-dev am: b56d6e13 am: 53b396ef" into rvc-d1-dev-plus-aosp
parents ebe8d482 a7a64361
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -2694,9 +2694,16 @@ class Task extends WindowContainer<WindowContainer> {
            return null;
            return null;
        }
        }


        final ActivityStack rootTask = (ActivityStack) focusableTask.getRootTask();
        if (!moveParentsToTop) {
            // Only move the next stack to top in its task container.
            WindowContainer parent = focusableTask.getParent();
            parent.positionChildAt(POSITION_TOP, focusableTask, false /* includingParents */);
            return rootTask;
        }

        final String myReason = reason + " adjustFocusToNextFocusableStack";
        final String myReason = reason + " adjustFocusToNextFocusableStack";
        final ActivityRecord top = focusableTask.topRunningActivity();
        final ActivityRecord top = focusableTask.topRunningActivity();
        final ActivityStack rootTask = (ActivityStack) focusableTask.getRootTask();
        if (focusableTask.isActivityTypeHome() && (top == null || !top.mVisibleRequested)) {
        if (focusableTask.isActivityTypeHome() && (top == null || !top.mVisibleRequested)) {
            // If we will be focusing on the home stack next and its current top activity isn't
            // If we will be focusing on the home stack next and its current top activity isn't
            // visible, then use the move the home stack task to top to make the activity visible.
            // visible, then use the move the home stack task to top to make the activity visible.
@@ -2704,13 +2711,6 @@ class Task extends WindowContainer<WindowContainer> {
            return rootTask;
            return rootTask;
        }
        }


        if (!moveParentsToTop) {
            // Only move the next stack to top in its task container.
            WindowContainer parent = focusableTask.getParent();
            parent.positionChildAt(POSITION_TOP, focusableTask, false /* includingParents */);
            return rootTask;
        }

        // Move the entire hierarchy to top with updating global top resumed activity
        // Move the entire hierarchy to top with updating global top resumed activity
        // and focused application if needed.
        // and focused application if needed.
        focusableTask.moveToFront(myReason);
        focusableTask.moveToFront(myReason);