Fix crash in InputManagerService

We are currently storing a local variable into permanent storage, which
causes jni abort, unsurprisingly. Make this a global ref instead.

Bug: 120255803
Test: eng build boots properly
Change-Id: Ie572d7cfdb6799af99c10aa8ade96c0fbc4eab2b
This commit is contained in:
Siarhei Vishniakou
2018-11-30 09:45:52 -08:00
parent 46502d7774
commit f9868961a2

View File

@@ -1750,7 +1750,7 @@ int register_android_server_InputManager(JNIEnv* env) {
jclass clazz;
FIND_CLASS(clazz, "com/android/server/input/InputManagerService");
gServiceClassInfo.clazz = clazz;
gServiceClassInfo.clazz = reinterpret_cast<jclass>(env->NewGlobalRef(clazz));
GET_METHOD_ID(gServiceClassInfo.notifyConfigurationChanged, clazz,
"notifyConfigurationChanged", "(J)V");