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

Commit 7614cdf9 authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev
Browse files

Exit touch mode on mouse/stylus click

Bug: 35625345
Test: android.cts.view.ViewTest#testTouchMode
Change-Id: Ib31425c3da2c42a4df91735be4057d2aa8db7480
parent 1c1c4979
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -4279,11 +4279,11 @@ public final class ViewRootImpl implements ViewParent,
                mTranslator.translateEventInScreenToAppWindow(event);
            }

            // Enter touch mode on down or scroll.
            // Enter touch mode on down or scroll, if it is coming from a touch screen device,
            // exit otherwise.
            final int action = event.getAction();
            if (event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN)
                    && (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_SCROLL)) {
                ensureTouchMode(true);
            if (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_SCROLL) {
                ensureTouchMode(event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN));
            }

            if (action == MotionEvent.ACTION_DOWN && mAttachInfo.mTooltipHost != null) {