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

Commit 75e5029e authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev
Browse files

Do not enter touch mode on non-touchscreen events

Currently ACTION_DOWN and ACTION_SCROLL cause
entering touch mode regardless of the event source.
This is especially awkward for mouse.

This should only happen when the event source is
SOURCE_TOUCHSCREEN.

Bug: 35314124
Test: android.cts.view.ViewTest#testTouchMode
Change-Id: I2205d4240be4afcbd9a3ac5558e701f7cac51926
parent d0e10222
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4279,7 +4279,8 @@ public final class ViewRootImpl implements ViewParent,

            // Enter touch mode on down or scroll.
            final int action = event.getAction();
            if (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_SCROLL) {
            if (event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN)
                    && (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_SCROLL)) {
                ensureTouchMode(true);
            }