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
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index b36a8a7..43d2dcf 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -1750,7 +1750,7 @@
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");