summaryrefslogtreecommitdiff
path: root/quickstep/src/com/android/quickstep/views/RecentsView.java
diff options
context:
space:
mode:
Diffstat (limited to 'quickstep/src/com/android/quickstep/views/RecentsView.java')
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsView.java10
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