From 8bcf485ac4c61290facfcb28dadee7535901a42c Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Wed, 17 Jan 2024 11:44:31 +0000 Subject: [PATCH] Add flag guard to hover actions in TouchInteractionService. Flag: ACONFIG com.android.launcher3.enable_cursor_hover_states NEXTFOOD Test: Manual. Bug: 306745595 Change-Id: I74818f517b84c4aba8a7dd4a77397495595bbef5 --- .../src/com/android/quickstep/TouchInteractionService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 86ba7ef49a..e3c1c3b94c 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -23,6 +23,7 @@ import static android.view.MotionEvent.ACTION_POINTER_DOWN; import static android.view.MotionEvent.ACTION_POINTER_UP; import static android.view.MotionEvent.ACTION_UP; +import static com.android.launcher3.Flags.enableCursorHoverStates; import static com.android.launcher3.Launcher.INTENT_ACTION_ALL_APPS_TOGGLE; import static com.android.launcher3.LauncherPrefs.backedUpItem; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; @@ -724,7 +725,8 @@ public class TouchInteractionService extends Service { final int action = event.getActionMasked(); // Note this will create a new consumer every mouse click, as after ACTION_UP from the click // an ACTION_HOVER_ENTER will fire as well. - boolean isHoverActionWithoutConsumer = isHoverActionWithoutConsumer(event); + boolean isHoverActionWithoutConsumer = enableCursorHoverStates() + && isHoverActionWithoutConsumer(event); CompoundString reasonString = action == ACTION_DOWN ? new CompoundString("onMotionEvent: ") : CompoundString.NO_OP; if (action == ACTION_DOWN || isHoverActionWithoutConsumer) {