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

Commit 7757972f authored by Harry Cutts's avatar Harry Cutts
Browse files

InputEventConsistencyVerifier: only check actual trackball events

The trackball event verification code hasn't been changed since 2011.
Since then, we've introduced InputDevice.SOURCE_MOUSE_RELATIVE (with
SOURCE_CLASS_TRACKBALL), which uses some different action types than
actual trackballs. This was causing the verifier to report problems
whenever a captured mouse emitted any action other than DOWN, MOVE, or
UP, meaning that valid BUTTON_PRESS, BUTTON_RELEASE, and SCROLL events
were causing errors to appear in logcat.

To avoid this, only apply the trackball validation logic to actual
trackballs.

Test: capture the mouse with a test app, click the buttons and scroll,
      and check that no "Invalid action" messages appear under the
      InputEventConsistencyVerifier log tag
Bug: 394541626
Flag: EXEMPT bug fix
Change-Id: I2ab57d9680817d396d01e720c36b80c6fe3320f0
parent 76f60eea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ public final class InputEventConsistencyVerifier {
            final MotionEvent motionEvent = (MotionEvent)event;
            if (motionEvent.isTouchEvent()) {
                onTouchEvent(motionEvent, nestingLevel);
            } else if ((motionEvent.getSource() & InputDevice.SOURCE_CLASS_TRACKBALL) != 0) {
            } else if (motionEvent.isFromSource(InputDevice.SOURCE_TRACKBALL)) {
                onTrackballEvent(motionEvent, nestingLevel);
            } else {
                onGenericMotionEvent(motionEvent, nestingLevel);