From 617f974e63b9e696cf578115a401d1a85534226e Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Wed, 28 May 2014 21:27:47 -0700 Subject: [PATCH] Remove dependencies on runtime_libdvm and libdvm.so in general Bug: 14298175 (cherry picked from commit aefe55f0fb9e69be205497ef4fc3432d2f7a2d8b) Change-Id: I05b1a7dd1ef30b3366b52b46bfc7b39cfb3be198 --- services/surfaceflinger/DdmConnection.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/services/surfaceflinger/DdmConnection.cpp b/services/surfaceflinger/DdmConnection.cpp index d2c977df6..2477921e3 100644 --- a/services/surfaceflinger/DdmConnection.cpp +++ b/services/surfaceflinger/DdmConnection.cpp @@ -45,18 +45,21 @@ void DdmConnection::start(const char* name) { args.ignoreUnrecognized = JNI_FALSE; - void* libdvm_dso = dlopen("libdvm.so", RTLD_NOW); - ALOGE_IF(!libdvm_dso, "DdmConnection: %s", dlerror()); + // TODO: Should this just link against libnativehelper and use its + // JNI_CreateJavaVM wrapper that essential does this dlopen/dlsym + // work based on the current system default runtime? + void* libart_dso = dlopen("libart.so", RTLD_NOW); + ALOGE_IF(!libart_dso, "DdmConnection: %s", dlerror()); void* libandroid_runtime_dso = dlopen("libandroid_runtime.so", RTLD_NOW); ALOGE_IF(!libandroid_runtime_dso, "DdmConnection: %s", dlerror()); - if (!libdvm_dso || !libandroid_runtime_dso) { + if (!libart_dso || !libandroid_runtime_dso) { goto error; } jint (*JNI_CreateJavaVM)(JavaVM** p_vm, JNIEnv** p_env, void* vm_args); - JNI_CreateJavaVM = (typeof JNI_CreateJavaVM)dlsym(libdvm_dso, "JNI_CreateJavaVM"); + JNI_CreateJavaVM = (typeof JNI_CreateJavaVM)dlsym(libart_dso, "JNI_CreateJavaVM"); ALOGE_IF(!JNI_CreateJavaVM, "DdmConnection: %s", dlerror()); jint (*registerNatives)(JNIEnv* env, jclass clazz); @@ -104,8 +107,8 @@ error: if (libandroid_runtime_dso) { dlclose(libandroid_runtime_dso); } - if (libdvm_dso) { - dlclose(libdvm_dso); + if (libart_dso) { + dlclose(libart_dso); } }