diff options
author | Alex Chau <alexchau@google.com> | 2021-09-01 18:43:40 +0100 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-09-15 00:10:47 +0000 |
commit | 0ab476cb92a7c2e826be60d9572964519eec5da8 (patch) | |
tree | 39d4e99a8be430182aa45f2255ef5b56531a2dc0 | |
parent | af79a6ff8cde6a3c2466d3ff5cea0caa3792959e (diff) | |
download | Launcher3-0ab476cb92a7c2e826be60d9572964519eec5da8.tar.gz |
Only call setCurrentPage in applyLoadPlan if mCurrentPage is outdated
- Apply the same for all 3 setCurrentPage cases as they can all causes page jumping
Bug: 197493120
Test: manual
Change-Id: I5f7013ce3ce4d6fe84c67123618c3bebeeffc43a
Merged-In: I5f7013ce3ce4d6fe84c67123618c3bebeeffc43a
(cherry picked from commit dacb37c1435e68be5c96d374ba18cd58c37a19dd)
-rw-r--r-- | quickstep/src/com/android/quickstep/views/RecentsView.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index ce79125be1..388706071c 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -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 |