From 920a86969adc5a95d1b9310fc3b7c76932eb558f Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Thu, 9 Jun 2022 11:24:17 -0700 Subject: [PATCH] Forcefully move focused task to front when triggering the recents animation in 3-button nav Quickly tapping the recents button can start a recents animation while a quick switch is running. This causes the the wrong page index to be used as the focused task index. Test: manual on large screen Fixes: 227562351 Change-Id: If99f74477e52ed0c7f7c5fd7b3dc8b201627068b --- .../src/com/android/quickstep/OverviewCommandHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index dffdc5a641..1e7e89e034 100644 --- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -235,6 +235,10 @@ public class OverviewCommandHelper { } }; + RecentsView visibleRecentsView = activityInterface.getVisibleRecentsView(); + if (visibleRecentsView != null) { + visibleRecentsView.moveFocusedTaskToFront(); + } if (mTaskAnimationManager.isRecentsAnimationRunning()) { cmd.mActiveCallbacks = mTaskAnimationManager.continueRecentsAnimation(gestureState); cmd.mActiveCallbacks.addListener(interactionHandler);