diff options
Diffstat (limited to 'core/jni/android_view_InputQueue.cpp')
-rw-r--r-- | core/jni/android_view_InputQueue.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/core/jni/android_view_InputQueue.cpp b/core/jni/android_view_InputQueue.cpp index 21b73b1..96ccdee 100644 --- a/core/jni/android_view_InputQueue.cpp +++ b/core/jni/android_view_InputQueue.cpp @@ -33,6 +33,8 @@ #include "android_view_KeyEvent.h" #include "android_view_MotionEvent.h" +#include "core_jni_helpers.h" + namespace android { static struct { @@ -256,27 +258,13 @@ static const JNINativeMethod g_methods[] = { static const char* const kInputQueuePathName = "android/view/InputQueue"; -#define FIND_CLASS(var, className) \ - do { \ - var = env->FindClass(className); \ - LOG_FATAL_IF(! var, "Unable to find class %s", className); \ - } while(0) - -#define GET_METHOD_ID(var, clazz, methodName, fieldDescriptor) \ - do { \ - var = env->GetMethodID(clazz, methodName, fieldDescriptor); \ - LOG_FATAL_IF(! var, "Unable to find method" methodName); \ - } while(0) - int register_android_view_InputQueue(JNIEnv* env) { - jclass clazz; - FIND_CLASS(clazz, kInputQueuePathName); - GET_METHOD_ID(gInputQueueClassInfo.finishInputEvent, clazz, "finishInputEvent", "(JZ)V"); + jclass clazz = FindClassOrDie(env, kInputQueuePathName); + gInputQueueClassInfo.finishInputEvent = GetMethodIDOrDie(env, clazz, "finishInputEvent", + "(JZ)V"); - return AndroidRuntime::registerNativeMethods( - env, kInputQueuePathName, - g_methods, NELEM(g_methods)); + return RegisterMethodsOrDie(env, kInputQueuePathName, g_methods, NELEM(g_methods)); } } // namespace android |