TouchInputMapper: don't check touchpad touches by screen bounds
Uncaptured touchpads (with DeviceMode::POINTER) still on the old stack
(i.e. the Sony DualShock 4 touchpad) were having touches ignored if they
started at coordinates that would be outside of the bounds of the
touchscreen. Since touchpads use relative motions and don't directly
relate raw touch locations to screen locations, this was incorrect, and
caused touches to be ignored with certain screen/touchpad dimension and
orientation combinations.
Bug: 280396539
Test: connect Sony DualShock 4 by USB, rotate screen to portrait, check
touches starting in all areas of the pad are turned into pointer
movements
Test: atest inputflinger_tests
Change-Id: I9a92ba79246ee8fc25418c2e248ae2c3839a0d58
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
index f4d50b8..f2b0a4b 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -1889,9 +1889,9 @@
uint32_t id = mCurrentRawState.rawPointerData.touchingIdBits.firstMarkedBit();
const RawPointerData::Pointer& pointer = mCurrentRawState.rawPointerData.pointerForId(id);
// Skip checking whether the pointer is inside the physical frame if the device is in
- // unscaled mode.
+ // unscaled or pointer mode.
if (!isPointInsidePhysicalFrame(pointer.x, pointer.y) &&
- mDeviceMode != DeviceMode::UNSCALED) {
+ mDeviceMode != DeviceMode::UNSCALED && mDeviceMode != DeviceMode::POINTER) {
// If exactly one pointer went down, check for virtual key hit.
// Otherwise, we will drop the entire stroke.
if (mCurrentRawState.rawPointerData.touchingIdBits.count() == 1) {