Support pointer capture in InputReader
When pointer capture is enabled, the pointer icon is hidden,
the pointer location is not changing, and CursorInputMapper
generates "captured" events with relative offsets instead of
absolute positions.
Captured events have their source set to a newly introduced
SOURCE_MOUSE_RELATIVE (of SOURCE_CLASS_TRACKBALL).
Test: InputReader_test --gtest_filter=
CursorInputMapperTest.Process_PointerCapture
Bug: 30897034
Change-Id: Id30cb8e7edac56ab813e22a834cc44ab263d1003
diff --git a/include/android/input.h b/include/android/input.h
index f928c6e..0829989 100644
--- a/include/android/input.h
+++ b/include/android/input.h
@@ -835,6 +835,8 @@
AINPUT_SOURCE_BLUETOOTH_STYLUS = 0x00008000 | AINPUT_SOURCE_STYLUS,
/** trackball */
AINPUT_SOURCE_TRACKBALL = 0x00010000 | AINPUT_SOURCE_CLASS_NAVIGATION,
+ /** mouse relative */
+ AINPUT_SOURCE_MOUSE_RELATIVE = 0x00020000 | AINPUT_SOURCE_CLASS_NAVIGATION,
/** touchpad */
AINPUT_SOURCE_TOUCHPAD = 0x00100000 | AINPUT_SOURCE_CLASS_POSITION,
/** navigation */