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
Loading
Please register or sign in to comment