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

Commit fd8f7cd7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correct jni declarations of input handle"

parents 80f2a992 cd958bcc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@ extern int register_android_graphics_text_MeasuredText(JNIEnv* env);
extern int register_android_graphics_text_LineBreaker(JNIEnv *env);
extern int register_android_view_DisplayEventReceiver(JNIEnv* env);
extern int register_android_view_DisplayListCanvas(JNIEnv* env);
extern int register_android_view_InputApplicationHandle(JNIEnv* env);
extern int register_android_view_InputWindowHandle(JNIEnv* env);
extern int register_android_view_TextureLayer(JNIEnv* env);
extern int register_android_view_RenderNode(JNIEnv* env);
extern int register_android_view_RenderNodeAnimator(JNIEnv* env);
@@ -1370,6 +1372,8 @@ static const RegJNIRec gRegJNI[] = {
    REG_JNI(register_android_view_RenderNode),
    REG_JNI(register_android_view_RenderNodeAnimator),
    REG_JNI(register_android_view_DisplayListCanvas),
    REG_JNI(register_android_view_InputApplicationHandle),
    REG_JNI(register_android_view_InputWindowHandle),
    REG_JNI(register_android_view_TextureLayer),
    REG_JNI(register_android_view_ThreadedRenderer),
    REG_JNI(register_android_view_Surface),
+6 −6
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ bool NativeInputApplicationHandle::updateInfo() {

// --- Global functions ---

sp<InputApplicationHandle> android_server_InputApplicationHandle_getHandle(
sp<InputApplicationHandle> android_view_InputApplicationHandle_getHandle(
        JNIEnv* env, jobject inputApplicationHandleObj) {
    if (!inputApplicationHandleObj) {
        return NULL;
@@ -108,7 +108,7 @@ sp<InputApplicationHandle> android_server_InputApplicationHandle_getHandle(
    } else {
        jweak objWeak = env->NewWeakGlobalRef(inputApplicationHandleObj);
        handle = new NativeInputApplicationHandle(objWeak);
        handle->incStrong((void*)android_server_InputApplicationHandle_getHandle);
        handle->incStrong((void*)android_view_InputApplicationHandle_getHandle);
        env->SetLongField(inputApplicationHandleObj, gInputApplicationHandleClassInfo.ptr,
                reinterpret_cast<jlong>(handle));
    }
@@ -118,7 +118,7 @@ sp<InputApplicationHandle> android_server_InputApplicationHandle_getHandle(

// --- JNI ---

static void android_server_InputApplicationHandle_nativeDispose(JNIEnv* env, jobject obj) {
static void android_view_InputApplicationHandle_nativeDispose(JNIEnv* env, jobject obj) {
    AutoMutex _l(gHandleMutex);

    jlong ptr = env->GetLongField(obj, gInputApplicationHandleClassInfo.ptr);
@@ -126,7 +126,7 @@ static void android_server_InputApplicationHandle_nativeDispose(JNIEnv* env, job
        env->SetLongField(obj, gInputApplicationHandleClassInfo.ptr, 0);

        NativeInputApplicationHandle* handle = reinterpret_cast<NativeInputApplicationHandle*>(ptr);
        handle->decStrong((void*)android_server_InputApplicationHandle_getHandle);
        handle->decStrong((void*)android_view_InputApplicationHandle_getHandle);
    }
}

@@ -134,7 +134,7 @@ static void android_server_InputApplicationHandle_nativeDispose(JNIEnv* env, job
static const JNINativeMethod gInputApplicationHandleMethods[] = {
    /* name, signature, funcPtr */
    { "nativeDispose", "()V",
            (void*) android_server_InputApplicationHandle_nativeDispose },
            (void*) android_view_InputApplicationHandle_nativeDispose },
};

#define FIND_CLASS(var, className) \
@@ -145,7 +145,7 @@ static const JNINativeMethod gInputApplicationHandleMethods[] = {
        var = env->GetFieldID(clazz, fieldName, fieldDescriptor); \
        LOG_FATAL_IF(! (var), "Unable to find field " fieldName);

int register_android_server_InputApplicationHandle(JNIEnv* env) {
int register_android_view_InputApplicationHandle(JNIEnv* env) {
    int res = jniRegisterNativeMethods(env, "android/view/InputApplicationHandle",
            gInputApplicationHandleMethods, NELEM(gInputApplicationHandleMethods));
    (void) res;  // Faked use when LOG_NDEBUG.
+4 −4
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@
 * limitations under the License.
 */

#ifndef _ANDROID_SERVER_INPUT_APPLICATION_HANDLE_H
#define _ANDROID_SERVER_INPUT_APPLICATION_HANDLE_H
#ifndef _ANDROID_VIEW_INPUT_APPLICATION_HANDLE_H
#define _ANDROID_VIEW_INPUT_APPLICATION_HANDLE_H

#include <string>

@@ -40,9 +40,9 @@ private:
};


extern sp<InputApplicationHandle> android_server_InputApplicationHandle_getHandle(
extern sp<InputApplicationHandle> android_view_InputApplicationHandle_getHandle(
        JNIEnv* env, jobject inputApplicationHandleObj);

} // namespace android

#endif // _ANDROID_SERVER_INPUT_APPLICATION_HANDLE_H
#endif // _ANDROID_VIEW_INPUT_APPLICATION_HANDLE_H
+7 −7
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ bool NativeInputWindowHandle::updateInfo() {
            gInputWindowHandleClassInfo.inputApplicationHandle);
    if (inputApplicationHandleObj) {
        sp<InputApplicationHandle> inputApplicationHandle =
            android_server_InputApplicationHandle_getHandle(env, inputApplicationHandleObj);
            android_view_InputApplicationHandle_getHandle(env, inputApplicationHandleObj);
        if (inputApplicationHandle != nullptr) {
            inputApplicationHandle->updateInfo();
            mInfo.applicationInfo = *(inputApplicationHandle->getInfo());
@@ -174,7 +174,7 @@ bool NativeInputWindowHandle::updateInfo() {

// --- Global functions ---

sp<NativeInputWindowHandle> android_server_InputWindowHandle_getHandle(
sp<NativeInputWindowHandle> android_view_InputWindowHandle_getHandle(
        JNIEnv* env, jobject inputWindowHandleObj) {
    if (!inputWindowHandleObj) {
        return NULL;
@@ -189,7 +189,7 @@ sp<NativeInputWindowHandle> android_server_InputWindowHandle_getHandle(
    } else {
        jweak objWeak = env->NewWeakGlobalRef(inputWindowHandleObj);
        handle = new NativeInputWindowHandle(objWeak);
        handle->incStrong((void*)android_server_InputWindowHandle_getHandle);
        handle->incStrong((void*)android_view_InputWindowHandle_getHandle);
        env->SetLongField(inputWindowHandleObj, gInputWindowHandleClassInfo.ptr,
                reinterpret_cast<jlong>(handle));
    }
@@ -199,7 +199,7 @@ sp<NativeInputWindowHandle> android_server_InputWindowHandle_getHandle(

// --- JNI ---

static void android_server_InputWindowHandle_nativeDispose(JNIEnv* env, jobject obj) {
static void android_view_InputWindowHandle_nativeDispose(JNIEnv* env, jobject obj) {
    AutoMutex _l(gHandleMutex);

    jlong ptr = env->GetLongField(obj, gInputWindowHandleClassInfo.ptr);
@@ -207,7 +207,7 @@ static void android_server_InputWindowHandle_nativeDispose(JNIEnv* env, jobject
        env->SetLongField(obj, gInputWindowHandleClassInfo.ptr, 0);

        NativeInputWindowHandle* handle = reinterpret_cast<NativeInputWindowHandle*>(ptr);
        handle->decStrong((void*)android_server_InputWindowHandle_getHandle);
        handle->decStrong((void*)android_view_InputWindowHandle_getHandle);
    }
}

@@ -215,7 +215,7 @@ static void android_server_InputWindowHandle_nativeDispose(JNIEnv* env, jobject
static const JNINativeMethod gInputWindowHandleMethods[] = {
    /* name, signature, funcPtr */
    { "nativeDispose", "()V",
            (void*) android_server_InputWindowHandle_nativeDispose },
            (void*) android_view_InputWindowHandle_nativeDispose },
};

#define FIND_CLASS(var, className) \
@@ -226,7 +226,7 @@ static const JNINativeMethod gInputWindowHandleMethods[] = {
        var = env->GetFieldID(clazz, fieldName, fieldDescriptor); \
        LOG_FATAL_IF(! (var), "Unable to find field " fieldName);

int register_android_server_InputWindowHandle(JNIEnv* env) {
int register_android_view_InputWindowHandle(JNIEnv* env) {
    int res = jniRegisterNativeMethods(env, "android/view/InputWindowHandle",
            gInputWindowHandleMethods, NELEM(gInputWindowHandleMethods));
    (void) res;  // Faked use when LOG_NDEBUG.
+4 −4
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@
 * limitations under the License.
 */

#ifndef _ANDROID_SERVER_INPUT_WINDOW_HANDLE_H
#define _ANDROID_SERVER_INPUT_WINDOW_HANDLE_H
#ifndef _ANDROID_VIEW_INPUT_WINDOW_HANDLE_H
#define _ANDROID_VIEW_INPUT_WINDOW_HANDLE_H

#include <input/InputWindow.h>

@@ -38,9 +38,9 @@ private:
};


extern sp<NativeInputWindowHandle> android_server_InputWindowHandle_getHandle(
extern sp<NativeInputWindowHandle> android_view_InputWindowHandle_getHandle(
        JNIEnv* env, jobject inputWindowHandleObj);

} // namespace android

#endif // _ANDROID_SERVER_INPUT_WINDOW_HANDLE_H
#endif // _ANDROID_VIEW_INPUT_WINDOW_HANDLE_H
Loading