From 38f79bd4f56c60b258aaf1155b75cf107ef6c47c Mon Sep 17 00:00:00 2001 From: jioana Date: Tue, 16 Jul 2024 16:04:13 +0000 Subject: 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: I8c68530503b0b4e9af7a085c50ed051e23379f1f --- core/jni/android_view_MotionEvent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/android_view_MotionEvent.cpp b/core/jni/android_view_MotionEvent.cpp index d32486c73db2..240be3fe5534 100644 --- a/core/jni/android_view_MotionEvent.cpp +++ b/core/jni/android_view_MotionEvent.cpp @@ -415,7 +415,7 @@ static void android_view_MotionEvent_nativeAddBatch(JNIEnv* env, jclass clazz, env->DeleteLocalRef(pointerCoordsObj); } - event->addSample(eventTimeNanos, rawPointerCoords.data()); + event->addSample(eventTimeNanos, rawPointerCoords.data(), event->getId()); event->setMetaState(event->getMetaState() | metaState); } -- cgit v1.2.3-59-g8ed1b