Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38f79bd4 authored by jioana's avatar jioana
Browse files

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
parent a3fd9586
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
}