CapturedTouchpadEventConverter: filter out palms
When a touchpad marks a touch as a palm, we don't want to pass it on to
apps that have captured the touchpad. In future, we could pass these
through if we wanted by removing @hide from MotionEvent.TOOL_TYPE_PALM
and using that to denote palm touches.
Bug: b/259547750
Test: atest inputflinger_tests
Test: on a suitable touchpad captured by a test app, move a palm around.
Check it's not reported at all when the pad identifies it straight
away, and that it's cancelled when identified after touching down.
(`getevent -l | grep TOOL_TYPE` is useful to tell when the pad
changes its classification of the touch)
Change-Id: Iefe84120321246f3661a4d2d06e0ec01ba9fe52b
diff --git a/services/inputflinger/reader/mapper/CapturedTouchpadEventConverter.h b/services/inputflinger/reader/mapper/CapturedTouchpadEventConverter.h
index d81692d..9b6df7a 100644
--- a/services/inputflinger/reader/mapper/CapturedTouchpadEventConverter.h
+++ b/services/inputflinger/reader/mapper/CapturedTouchpadEventConverter.h
@@ -53,7 +53,7 @@
[[nodiscard]] NotifyMotionArgs makeMotionArgs(nsecs_t when, nsecs_t readTime, int32_t action,
const std::vector<PointerCoords>& coords,
const std::vector<PointerProperties>& properties,
- int32_t actionButton = 0);
+ int32_t actionButton = 0, int32_t flags = 0);
PointerCoords makePointerCoordsForSlot(const MultiTouchMotionAccumulator::Slot& slot) const;
int32_t allocatePointerIdToSlot(size_t slotNumber);
void freePointerIdForSlot(size_t slotNumber);