summaryrefslogtreecommitdiffstats
path: root/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java')
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index a3bd348e2..e1085e608 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -923,7 +923,15 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
windowAnim.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationSuccess(Animator animator) {
- setStateOnUiThread(target.endState);
+ if (target == NEW_TASK && mRecentsView != null
+ && mRecentsView.getNextPage() == mRecentsView.getRunningTaskIndex()) {
+ // We are about to launch the current running task, so use LAST_TASK state
+ // instead of NEW_TASK. This could happen, for example, if our scroll is
+ // aborted after we determined the target to be NEW_TASK.
+ setStateOnUiThread(LAST_TASK.endState);
+ } else {
+ setStateOnUiThread(target.endState);
+ }
}
});
windowAnim.start();