Move MotionEvent#split implementation to native

There is already a native implementation of split in InputDispatcher.
Prevent code duplication by moving the Java impl to native. The Java
impl is not correct, because it cannot access all values like the
transforms to initialize the split event with.

Bug: 326171104
Test: atest libinput_tests
Test: atest inputflinger_tests
Change-Id: I6230b6aa0696dcfc275a5a14ab4af3d4b7bd0b45
diff --git a/include/input/Input.h b/include/input/Input.h
index a84dcfc..374254f 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -870,6 +870,10 @@
 
     void copyFrom(const MotionEvent* other, bool keepHistory);
 
+    // Initialize this event by keeping only the pointers from "other" that are in splitPointerIds.
+    void splitFrom(const MotionEvent& other, std::bitset<MAX_POINTER_ID + 1> splitPointerIds,
+                   int32_t newEventId);
+
     void addSample(
             nsecs_t eventTime,
             const PointerCoords* pointerCoords);
@@ -910,6 +914,11 @@
 
     static std::string actionToString(int32_t action);
 
+    static std::tuple<int32_t /*action*/, std::vector<PointerProperties>,
+                      std::vector<PointerCoords>>
+    split(int32_t action, int32_t flags, int32_t historySize, const std::vector<PointerProperties>&,
+          const std::vector<PointerCoords>&, std::bitset<MAX_POINTER_ID + 1> splitPointerIds);
+
     // MotionEvent will transform various axes in different ways, based on the source. For
     // example, the x and y axes will not have any offsets/translations applied if it comes from a
     // relative mouse device (since SOURCE_RELATIVE_MOUSE is a non-pointer source). These methods