Allow stylus events in PalmRejector

After some recent changes, the touchscreen input device has source that
is a combination of SOURCE_TOUCHSCREEN and SOURCE_STYLUS.

Before this CL, this source is rejected, and therefore palm rejection
feature is not enabled.

With this CL, any source that has SOURCE_TOUCHSCREEN is allowed. That
also means that we potentially would invoke the model for stylus events,
especially if simultaneous touch and stylus are enabled.

The model, however, was never trained on stylus, and is not designed to
work with it. In preparation to upcoming simultaneous touch+stylus
feature, in this CL we also remove the stylus pointers before sending
the data to the model.

The only case where we need to be careful is pointer-down and pointer-up
events with stylus. In this CL, we drop these events, which should be a
no-op from the palm rejection model's perpective.

Bug: 241935838
Test: atest libpalmrejection_test inputflinger_tests
Change-Id: I760207a82807e03802e72a318fca8b97a4fd7a24
diff --git a/services/inputflinger/UnwantedInteractionBlocker.h b/services/inputflinger/UnwantedInteractionBlocker.h
index a176a98..5d0dde8 100644
--- a/services/inputflinger/UnwantedInteractionBlocker.h
+++ b/services/inputflinger/UnwantedInteractionBlocker.h
@@ -43,6 +43,25 @@
 
 static constexpr int32_t ACTION_UNKNOWN = -1;
 
+/**
+ * Remove the data for the provided pointers from the args. The pointers are identified by their
+ * pointerId, not by the index inside the array.
+ * Return the new NotifyMotionArgs struct that has the remaining pointers.
+ * The only fields that may be different in the returned args from the provided args are:
+ *     - action
+ *     - pointerCount
+ *     - pointerProperties
+ *     - pointerCoords
+ * Action might change because it contains a pointer index. If another pointer is removed, the
+ * active pointer index would be shifted.
+ *
+ * If the active pointer id is removed (for example, for events like
+ * POINTER_UP or POINTER_DOWN), then the action is set to ACTION_UNKNOWN. It is up to the caller
+ * to set the action appropriately after the call.
+ *
+ * @param args the args from which the pointers should be removed
+ * @param pointerIds the pointer ids of the pointers that should be removed
+ */
 NotifyMotionArgs removePointerIds(const NotifyMotionArgs& args,
                                   const std::set<int32_t>& pointerIds);