Fix JNI NULL class error
SysUI crashed after enable gesture navigation on eng build Bug: 124305231 Test: atest CompositionSamplingListenerTest Change-Id: I311a07c60fc9ed592f16d286772aed0e3657638e
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#define LOG_TAG "CompositionSamplingListener"
|
||||
|
||||
#include "android_util_Binder.h"
|
||||
#include "core_jni_helpers.h"
|
||||
|
||||
#include <nativehelper/JNIHelp.h>
|
||||
|
||||
@@ -122,6 +123,7 @@ int register_android_view_CompositionSamplingListener(JNIEnv* env) {
|
||||
LOG_ALWAYS_FATAL_IF(res < 0, "Unable to register native methods.");
|
||||
|
||||
jclass clazz = env->FindClass("android/view/CompositionSamplingListener");
|
||||
gListenerClassInfo.mClass = MakeGlobalRefOrDie(env, clazz);
|
||||
gListenerClassInfo.mDispatchOnSampleCollected = env->GetStaticMethodID(
|
||||
clazz, "dispatchOnSampleCollected", "(Landroid/view/CompositionSamplingListener;F)V");
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user