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

Unverified Commit 493b2c77 authored by LuK1337's avatar LuK1337 Committed by Michael Bestas
Browse files

core: jni: Add backwards compat methods for QCOM WFD

Change-Id: I02ee819f90af73d6af33a7acd68011c08438b926
parent b966ea25
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -115,6 +115,11 @@ ScopedLocalRef<jobject> android_view_KeyEvent_obtainAsCopy(JNIEnv* env, const Ke
    return eventObj;
    return eventObj;
}
}


jobject android_view_KeyEvent_fromNative(JNIEnv* env, const KeyEvent& event)
{
    return android_view_KeyEvent_obtainAsCopy(env, event).release();
}

KeyEvent android_view_KeyEvent_obtainAsCopy(JNIEnv* env, jobject eventObj) {
KeyEvent android_view_KeyEvent_obtainAsCopy(JNIEnv* env, jobject eventObj) {
    jint id = env->GetIntField(eventObj, gKeyEventClassInfo.mId);
    jint id = env->GetIntField(eventObj, gKeyEventClassInfo.mId);
    jint deviceId = env->GetIntField(eventObj, gKeyEventClassInfo.mDeviceId);
    jint deviceId = env->GetIntField(eventObj, gKeyEventClassInfo.mDeviceId);
@@ -140,6 +145,11 @@ KeyEvent android_view_KeyEvent_obtainAsCopy(JNIEnv* env, jobject eventObj) {
    return event;
    return event;
}
}


KeyEvent android_view_KeyEvent_toNative(JNIEnv* env, jobject eventObj)
{
    return android_view_KeyEvent_obtainAsCopy(env, eventObj);
}

status_t android_view_KeyEvent_recycle(JNIEnv* env, jobject eventObj) {
status_t android_view_KeyEvent_recycle(JNIEnv* env, jobject eventObj) {
    env->CallVoidMethod(eventObj, gKeyEventClassInfo.recycle);
    env->CallVoidMethod(eventObj, gKeyEventClassInfo.recycle);
    if (env->ExceptionCheck()) {
    if (env->ExceptionCheck()) {
+3 −0
Original line number Original line Diff line number Diff line
@@ -31,10 +31,13 @@ class KeyEvent;
 * Returns NULL on error. */
 * Returns NULL on error. */
extern ScopedLocalRef<jobject> android_view_KeyEvent_obtainAsCopy(JNIEnv* env,
extern ScopedLocalRef<jobject> android_view_KeyEvent_obtainAsCopy(JNIEnv* env,
                                                                  const KeyEvent& event);
                                                                  const KeyEvent& event);
extern jobject android_view_KeyEvent_fromNative(JNIEnv* env,
                                                const KeyEvent& event);


/* Copies the contents of a DVM KeyEvent object to a native KeyEvent instance.
/* Copies the contents of a DVM KeyEvent object to a native KeyEvent instance.
 * Returns non-zero on error. */
 * Returns non-zero on error. */
extern KeyEvent android_view_KeyEvent_obtainAsCopy(JNIEnv* env, jobject eventObj);
extern KeyEvent android_view_KeyEvent_obtainAsCopy(JNIEnv* env, jobject eventObj);
extern KeyEvent android_view_KeyEvent_toNative(JNIEnv* env, jobject event);


/* Recycles a DVM KeyEvent object.
/* Recycles a DVM KeyEvent object.
 * Key events should only be recycled if they are owned by the system since user
 * Key events should only be recycled if they are owned by the system since user