Remove dependencies on headers outside UI module
This includes AndroidRuntime and core_jni_helper.h
Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: If3d26f41eaf4981505ee47634097f3645fd563fd
diff --git a/libs/hwui/apex/jni_runtime.cpp b/libs/hwui/apex/jni_runtime.cpp
index c674f93..a114e2f 100644
--- a/libs/hwui/apex/jni_runtime.cpp
+++ b/libs/hwui/apex/jni_runtime.cpp
@@ -21,6 +21,7 @@
#include <sys/cdefs.h>
#include <EGL/egl.h>
+#include <GraphicsJNI.h>
#include <Properties.h>
#include <SkGraphics.h>
@@ -150,6 +151,10 @@
}
int register_android_graphics_classes(JNIEnv *env) {
+ JavaVM* vm = nullptr;
+ env->GetJavaVM(&vm);
+ GraphicsJNI::setJavaVM(vm);
+
for (size_t i = 0; i < NELEM(android::gRegJNI); i++) {
if (android::gRegJNI[i].mProc(env) < 0) {
#ifndef NDEBUG