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

Commit a4e9f70a authored by Harry Cutts's avatar Harry Cutts
Browse files

CursorInputMapper: fix simultaneous button and move handling

Previously, if we received movement (REL_X and REL_Y) as well as button
changes (BTN_*) from a mouse in the same evdev frame (i.e. not separated
by a SYN_REPORT), we'd add the relative movements to the DOWN or UP
event (as well as the BUTTON_PRESS or BUTTON_RELEASE events, which I'm
pretty sure was an additional bug), without adding a HOVER_MOVE or MOVE
event. This is invalid, and would cause the dispatcher to crash.

As a side effect of fixing this, we no longer emit extra MOVE or
HOVER_MOVE events for frames which only contain button changes.

Test: $ atest --host inputflinger_tests
Test: $ atest CtsInputTestCases
Test: $ atest CtsHardwareTestCases_cts_tests:android.hardware.input.cts.tests.VirtualMouseTest
Test: $ atest CtsHardwareTestCases_cts_tests:android.hardware.input.cts.tests.VirtualDeviceMirrorDisplayTest
Test: enable the verifier and use a mouse for a while (including
      clicking and dragging)
Bug: 405820964
Flag: EXEMPT bug fix
Change-Id: Iabadc3be9594c5b56c26aaeae6082254527060de
parent 509f6297
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment