Add ChromeOS palm rejection model
This model will be used to block palm presses. It takes in a stream of
evdev events, and reports back the pointers which should be considered
palm.
Bug: 198472780
Test: atest libpalmrejection_test inputflinger_tests
Test: "adb shell device_config put input_native_boot
palm_rejection_enabled 0" and make sure that "adb shell dumpsys input"
shows that there aren't any palm rejectors inside
UnwantedInteractionBlocker
Change-Id: If979d335af29cf5e93b26336fea56a3a895cc562
diff --git a/services/inputflinger/InputClassifierConverter.cpp b/services/inputflinger/InputClassifierConverter.cpp
index fc8c7c3..b58a188 100644
--- a/services/inputflinger/InputClassifierConverter.cpp
+++ b/services/inputflinger/InputClassifierConverter.cpp
@@ -325,11 +325,6 @@
return out;
}
-static uint8_t getActionIndex(int32_t action) {
- return (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >>
- AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
-}
-
static void getHidlPropertiesAndCoords(const NotifyMotionArgs& args,
std::vector<common::V1_0::PointerProperties>* outPointerProperties,
std::vector<common::V1_0::PointerCoords>* outPointerCoords) {
@@ -360,7 +355,7 @@
event.eventTime = args.eventTime;
event.deviceTimestamp = 0;
event.action = getAction(args.action & AMOTION_EVENT_ACTION_MASK);
- event.actionIndex = getActionIndex(args.action);
+ event.actionIndex = MotionEvent::getActionIndex(args.action);
event.actionButton = getActionButton(args.actionButton);
event.flags = getFlags(args.flags);
event.policyFlags = getPolicyFlags(args.policyFlags);