Add relative field to captured cursor device

Mice by their nature are relative devices, there is no concept of an
absolute position of the physical device. Pointer capture is designed
to provide apps the ability to get the raw motion of the mouse,
however, the relative motion of the mouse is provided in the AXIS_X/Y
fields, which are canonically used for absolute positions of touches
or cursors on the display.

This patch copies these relative values into the AXIS_RELATIVE_X/Y
fields so that apps that want exclusive relative information from a
captured input device can use the same field for both mice and
touchpads.

Test: connect a mouse to an android device and capture the pointer
      within an app. MotionEvents from onCapturedPointerEvent() should
      contain AXIS_RELATIVE_X/Y fields identical to the AXIS_X/Y
      field.

Bug: 38511270
Change-Id: Ib1dffb68411a5c632658715ab940bcf07d5181b8
1 file changed