Update MotionEvent's id when a new sample is added.
Until now the MotionEvent's id was set during the "initialize" call, and it was equal to the first sample's eventId. We want to use the latest sample's eventId.
Bug: b/350907221
Test: atest libinput_tests inputflinger_tests
Flag: EXEMPT bugfix
Change-Id: I0d967e7fe644fc2b2c09d044c3ee8ed13276d787
diff --git a/include/input/Input.h b/include/input/Input.h
index 77d7448..1a3cb6a 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -900,9 +900,7 @@
void splitFrom(const MotionEvent& other, std::bitset<MAX_POINTER_ID + 1> splitPointerIds,
int32_t newEventId);
- void addSample(
- nsecs_t eventTime,
- const PointerCoords* pointerCoords);
+ void addSample(nsecs_t eventTime, const PointerCoords* pointerCoords, int32_t eventId);
void offsetLocation(float xOffset, float yOffset);