From aac08cfbadb22268e20cb74f3fd8b4092406467e 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 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:8bcf485ac4c61290facfcb28dadee7535901a42c) Merged-In: I74818f517b84c4aba8a7dd4a77397495595bbef5 Change-Id: I74818f517b84c4aba8a7dd4a77397495595bbef5 --- .../src/com/android/quickstep/TouchInteractionService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 5baf6d43bd..5cbc7ffbb0 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -26,6 +26,7 @@ import static android.view.MotionEvent.ACTION_UP; import static com.android.launcher3.Launcher.INTENT_ACTION_ALL_APPS_TOGGLE; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe; +import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.ENABLE_TRACKPAD_GESTURE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH; @@ -689,8 +690,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 = - event.isHoverEvent() && (mUncheckedConsumer.getType() & TYPE_CURSOR_HOVER) == 0; + boolean isHoverActionWithoutConsumer = ENABLE_CURSOR_HOVER_STATES.get() + && event.isHoverEvent() && (mUncheckedConsumer.getType() & TYPE_CURSOR_HOVER) == 0; if (action == ACTION_DOWN || isHoverActionWithoutConsumer) { mRotationTouchHelper.setOrientationTransformIfNeeded(event);