diff options
author | Andreas Gampe <agampe@google.com> | 2014-11-18 17:29:46 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-11-19 09:21:12 -0800 |
commit | 987f79f60bb1f0a4bcd3ef22e57301c743f0b94f (patch) | |
tree | 0ca0916dade98039096346937279ee3587353ede /core/jni/android_view_RenderNode.cpp | |
parent | 8462913d0c19973901a861749b4abbaacdf4b477 (diff) | |
download | frameworks_base-987f79f60bb1f0a4bcd3ef22e57301c743f0b94f.zip frameworks_base-987f79f60bb1f0a4bcd3ef22e57301c743f0b94f.tar.gz frameworks_base-987f79f60bb1f0a4bcd3ef22e57301c743f0b94f.tar.bz2 |
Frameworks/base: Replace LOG_FATAL_IF in core/jni
Do not use LOG_FATAL_IF in JNI setup. This is one-time on startup
and important enough to always check.
Add a header with common helper definitions. Move to inlined functions
instead of macros to clean up the code.
Change-Id: Ib12d0eed61b110c45d748e80ec36c563e9dec7e5
Diffstat (limited to 'core/jni/android_view_RenderNode.cpp')
-rw-r--r-- | core/jni/android_view_RenderNode.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/core/jni/android_view_RenderNode.cpp b/core/jni/android_view_RenderNode.cpp index 050037e..d1e693b 100644 --- a/core/jni/android_view_RenderNode.cpp +++ b/core/jni/android_view_RenderNode.cpp @@ -28,6 +28,8 @@ #include <RenderNode.h> #include <Paint.h> +#include "core_jni_helpers.h" + namespace android { using namespace uirenderer; @@ -551,21 +553,8 @@ static JNINativeMethod gMethods[] = { #endif }; -#ifdef USE_OPENGL_RENDERER - #define FIND_CLASS(var, className) \ - var = env->FindClass(className); \ - LOG_FATAL_IF(! var, "Unable to find class " className); - - #define GET_METHOD_ID(var, clazz, methodName, methodDescriptor) \ - var = env->GetMethodID(clazz, methodName, methodDescriptor); \ - LOG_FATAL_IF(! var, "Unable to find method " methodName); -#else - #define FIND_CLASS(var, className) - #define GET_METHOD_ID(var, clazz, methodName, methodDescriptor) -#endif - int register_android_view_RenderNode(JNIEnv* env) { - return AndroidRuntime::registerNativeMethods(env, kClassPathName, gMethods, NELEM(gMethods)); + return RegisterMethodsOrDie(env, kClassPathName, gMethods, NELEM(gMethods)); } }; |