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

Commit 59fd3a9c authored by chaviw's avatar chaviw
Browse files

Update JNI to match new MotionEvent initialize

Bug: 158476194
Test: Builds and runs
Change-Id: Id0218e8e5ba382f5fbfb181b25678bbc22e09480
parent 3758432a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -144,9 +144,8 @@ status_t NativeInputEventSender::sendMotionEvent(uint32_t seq, const MotionEvent
                                                   event->getAction(), event->getActionButton(),
                                                   event->getFlags(), event->getEdgeFlags(),
                                                   event->getMetaState(), event->getButtonState(),
                                                   event->getClassification(), event->getXScale(),
                                                   event->getYScale(), event->getXOffset(),
                                                   event->getYOffset(), event->getXPrecision(),
                                                   event->getClassification(),
                                                   event->getTransform(), event->getXPrecision(),
                                                   event->getYPrecision(),
                                                   event->getRawXCursorPosition(),
                                                   event->getRawYCursorPosition(),
+9 −8
Original line number Diff line number Diff line
@@ -369,13 +369,14 @@ static jlong android_view_MotionEvent_nativeInitialize(
        env->DeleteLocalRef(pointerCoordsObj);
    }

    ui::Transform transform;
    transform.set(xOffset, yOffset);
    event->initialize(InputEvent::nextId(), deviceId, source, displayId, INVALID_HMAC, action, 0,
                      flags, edgeFlags, metaState, buttonState,
                      static_cast<MotionClassification>(classification), 1 /*xScale*/, 1 /*yScale*/,
                      xOffset, yOffset, xPrecision, yPrecision,
                      AMOTION_EVENT_INVALID_CURSOR_POSITION, AMOTION_EVENT_INVALID_CURSOR_POSITION,
                      downTimeNanos, eventTimeNanos, pointerCount, pointerProperties,
                      rawPointerCoords);
                      static_cast<MotionClassification>(classification), transform, xPrecision,
                      yPrecision, AMOTION_EVENT_INVALID_CURSOR_POSITION,
                      AMOTION_EVENT_INVALID_CURSOR_POSITION, downTimeNanos, eventTimeNanos,
                      pointerCount, pointerProperties, rawPointerCoords);

    return reinterpret_cast<jlong>(event.release());
}
@@ -569,9 +570,9 @@ static void android_view_MotionEvent_nativeTransform(JNIEnv* env, jclass clazz,
        jlong nativePtr, jobject matrixObj) {
    MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);

    float m[9];
    AMatrix_getContents(env, matrixObj, m);
    event->transform(m);
    std::array<float, 9> matrix;
    AMatrix_getContents(env, matrixObj, matrix.data());
    event->transform(matrix);
}

// ----------------- @CriticalNative ------------------------------