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

Commit 32d872b8 authored by Alex Chau's avatar Alex Chau Committed by Automerger Merge Worker
Browse files

Merge "Only call setCurrentPage in applyLoadPlan if mCurrentPage is outdated"...

Merge "Only call setCurrentPage in applyLoadPlan if mCurrentPage is outdated" into sc-dev am: 464fc41d

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15742147

Change-Id: I13e5176c8f53e176d8e94f418828452019deb8ff
parents 5ea5f903 464fc41d
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1146,20 +1146,24 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        }
        updateTaskSize();

        int targetPage = -1;
        if (mNextPage == INVALID_PAGE) {
            // Set the current page to the running task, but not if settling on new task.
            TaskView runningTaskView = getRunningTaskView();
            if (runningTaskView != null) {
                setCurrentPage(indexOfChild(runningTaskView));
                targetPage = indexOfChild(runningTaskView);
            } else if (getTaskViewCount() > 0) {
                setCurrentPage(indexOfChild(getTaskViewAt(0)));
                targetPage = indexOfChild(getTaskViewAt(0));
            }
        } else if (currentTaskId != -1) {
            currentTaskView = getTaskView(currentTaskId);
            if (currentTaskView != null) {
                setCurrentPage(indexOfChild(currentTaskView));
                targetPage = indexOfChild(currentTaskView);
            }
        }
        if (targetPage != -1 && mCurrentPage != targetPage) {
            setCurrentPage(targetPage);
        }

        if (mIgnoreResetTaskId != -1 && getTaskView(mIgnoreResetTaskId) != ignoreResetTaskView) {
            // If the taskView mapping is changing, do not preserve the visuals. Since we are