From a6451fc6408f11f2eb7d99f5fc9e2f10ed8950a4 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 16 Jul 2021 10:22:08 +0000 Subject: [PATCH] Revert "Move focused task to front when attaching RecentsView" This reverts commit 86ac825061d48d169998485f419208e851ee402c. Reason for revert: Causes crash in fallback recents Bug: 192471181 Change-Id: I41d2b5c87259568f21e6417be3a6dea5dd1a0864 --- .../android/quickstep/AbsSwipeUpHandler.java | 18 ++---------- .../quickstep/BaseActivityInterface.java | 13 --------- .../android/quickstep/views/RecentsView.java | 29 ------------------- 3 files changed, 3 insertions(+), 57 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index bda2b77bb3..9180bd026f 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -539,7 +539,7 @@ public abstract class AbsSwipeUpHandler, @Override public void onMotionPauseDetected() { mHasMotionEverBeenPaused = true; - maybeUpdateRecentsAttachedState(true/* animate */, true/* moveFocusedTask */); + maybeUpdateRecentsAttachedState(); performHapticFeedback(); } @@ -550,24 +550,18 @@ public abstract class AbsSwipeUpHandler, }; } - private void maybeUpdateRecentsAttachedState() { + public void maybeUpdateRecentsAttachedState() { maybeUpdateRecentsAttachedState(true /* animate */); } - private void maybeUpdateRecentsAttachedState(boolean animate) { - maybeUpdateRecentsAttachedState(animate, false /* moveFocusedTask */); - } - /** * Determines whether to show or hide RecentsView. The window is always * synchronized with its corresponding TaskView in RecentsView, so if * RecentsView is shown, it will appear to be attached to the window. * * Note this method has no effect unless the navigation mode is NO_BUTTON. - * @param animate whether to animate when attaching RecentsView - * @param moveFocusedTask whether to move focused task to front when attaching */ - private void maybeUpdateRecentsAttachedState(boolean animate, boolean moveFocusedTask) { + private void maybeUpdateRecentsAttachedState(boolean animate) { if (!mDeviceState.isFullyGesturalNavMode() || mRecentsView == null) { return; } @@ -586,12 +580,6 @@ public abstract class AbsSwipeUpHandler, } else { recentsAttachedToAppWindow = mHasMotionEverBeenPaused || mIsLikelyToStartNewTask; } - if (moveFocusedTask && !mAnimationFactory.hasRecentsEverAttachedToAppWindow() - && recentsAttachedToAppWindow) { - // Only move focused task if RecentsView has never been attached before, to avoid - // TaskView jumping to new position as we move the tasks. - mRecentsView.moveFocusedTaskToFront(); - } mAnimationFactory.setRecentsAttachedToAppWindow(recentsAttachedToAppWindow, animate); // Reapply window transform throughout the attach animation, as the animation affects how diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 389509f978..1412b1add6 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -396,10 +396,6 @@ public abstract class BaseActivityInterface mCallback; private boolean mIsAttachedToWindow; - private boolean mHasEverAttachedToWindow; DefaultAnimationFactory(Consumer callback) { mCallback = callback; @@ -463,9 +458,6 @@ public abstract class BaseActivityInterface tasks) { if (mPendingAnimation != null) { mPendingAnimation.addEndListener(success -> applyLoadPlan(tasks));