MotionEvent: Differentiate directional support for AXIS_ORIENTATION
We have three cases for handling AXIS_ORIENTATION: 1. Orientation is not supported by the input device, so the value for AXIS_ORIENTATION should always be 0, regardless of display rotation. 2. Orientation is supported, but a "direction" is not specified, like for touchscreens and touchpads. The orientation must be in the range [-pi/2, pi/2] for all display rotations. 3. Orientation is fully supported, and the value is in the range [-pi, pi] for all display rotations. It is insufficient to rely on whether or not the PointerCoords has the bit for AXIS_ORIENTATION set to determine whether the event has a valid orientation. This is because we always skip setting values of 0 for any axis in PointerCoords to save space during serialization. To support these three cases, we introduce two new MotionEvent private flags. These are flags that are not exposed to Java and to the public APIs. Bug: 263310669 Test: atest TouchScreenTest libinput_tests inputflinger_tests Change-Id: Iaa38afe35b00de74fbc5eefce25191bea52c2ea6
Loading
Please register or sign in to comment