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

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

Merge "Restore previous currentPage in applyLoadPlan in case task is...

Merge "Restore previous currentPage in applyLoadPlan in case task is re-ordered" into sc-dev am: 679f8bb9

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

Change-Id: I4cc43374c577299c7be3d63bb8a7393a90447231
parents 1dd0ca7b 679f8bb9
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1100,6 +1100,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
            return;
        }

        int currentTaskId = -1;
        TaskView currentTaskView = getTaskViewAtByAbsoluteIndex(mCurrentPage);
        if (currentTaskView != null) {
            currentTaskId = currentTaskView.getTask().key.id;
        }

        // Unload existing visible task data
        unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);

@@ -1142,6 +1148,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
            } else if (getTaskViewCount() > 0) {
                setCurrentPage(indexOfChild(getTaskViewAt(0)));
            }
        } else if (currentTaskId != -1) {
            currentTaskView = getTaskView(currentTaskId);
            if (currentTaskView != null) {
                setCurrentPage(indexOfChild(currentTaskView));
            }
        }

        if (mIgnoreResetTaskId != -1 && getTaskView(mIgnoreResetTaskId) != ignoreResetTaskView) {