summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author jioana <jioana@google.com> 2024-07-16 16:04:13 +0000
committer jioana <jioana@google.com> 2024-07-17 14:42:09 +0000
commit38f79bd4f56c60b258aaf1155b75cf107ef6c47c (patch)
tree3ca400408178540bcfcb945997e520a9960d2fef
parenta3fd958698f63c1125a11fc668abf9148b321690 (diff)
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
-rw-r--r--core/jni/android_view_MotionEvent.cpp2
1 files changed, 1 insertions, 1 deletions
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);
}