Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81540dbf authored by Ben Lin's avatar Ben Lin Committed by Automerger Merge Worker
Browse files

Merge "PIP: Disable hover show/hide menu if accessibility service is on." into...

Merge "PIP: Disable hover show/hide menu if accessibility service is on." into rvc-dev am: 6f6216d3 am: c4350a19

Change-Id: Ia3e6e38407512a36d55552d9f6da31e082427313
parents 08200084 c4350a19
Loading
Loading
Loading
Loading
+14 −3
Original line number Original line Diff line number Diff line
@@ -592,8 +592,14 @@ public class PipTouchHandler {
                break;
                break;
            }
            }
            case MotionEvent.ACTION_HOVER_ENTER:
            case MotionEvent.ACTION_HOVER_ENTER:
                // If Touch Exploration is enabled, some a11y services (e.g. Talkback) is probably
                // on and changing MotionEvents into HoverEvents.
                // Let's not enable menu show/hide for a11y services.
                if (!mAccessibilityManager.isTouchExplorationEnabled()) {
                    mMenuController.showMenu(MENU_STATE_FULL, mMotionHelper.getBounds(),
                    mMenuController.showMenu(MENU_STATE_FULL, mMotionHelper.getBounds(),
                        mMovementBounds, false /* allowMenuTimeout */, false /* willResizeMenu */);
                            mMovementBounds, false /* allowMenuTimeout */,
                            false /* willResizeMenu */);
                }
            case MotionEvent.ACTION_HOVER_MOVE: {
            case MotionEvent.ACTION_HOVER_MOVE: {
                if (!shouldDeliverToMenu && !mSendingHoverAccessibilityEvents) {
                if (!shouldDeliverToMenu && !mSendingHoverAccessibilityEvents) {
                    sendAccessibilityHoverEvent(AccessibilityEvent.TYPE_VIEW_HOVER_ENTER);
                    sendAccessibilityHoverEvent(AccessibilityEvent.TYPE_VIEW_HOVER_ENTER);
@@ -602,7 +608,12 @@ public class PipTouchHandler {
                break;
                break;
            }
            }
            case MotionEvent.ACTION_HOVER_EXIT: {
            case MotionEvent.ACTION_HOVER_EXIT: {
                // If Touch Exploration is enabled, some a11y services (e.g. Talkback) is probably
                // on and changing MotionEvents into HoverEvents.
                // Let's not enable menu show/hide for a11y services.
                if (!mAccessibilityManager.isTouchExplorationEnabled()) {
                    mMenuController.hideMenu();
                    mMenuController.hideMenu();
                }
                if (!shouldDeliverToMenu && mSendingHoverAccessibilityEvents) {
                if (!shouldDeliverToMenu && mSendingHoverAccessibilityEvents) {
                    sendAccessibilityHoverEvent(AccessibilityEvent.TYPE_VIEW_HOVER_EXIT);
                    sendAccessibilityHoverEvent(AccessibilityEvent.TYPE_VIEW_HOVER_EXIT);
                    mSendingHoverAccessibilityEvents = false;
                    mSendingHoverAccessibilityEvents = false;