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

Commit 7b313224 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Only call setCurrentPage in applyLoadPlan if mCurrentPage is outdated" into sc-v2-dev

parents c9d09cac 06c7d0cb
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1357,21 +1357,22 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
            }
        }

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

        if (mIgnoreResetTaskId != -1 &&