am f3e4fda0
: Merge "Remove dependencies on runtime_libdvm and libdvm.so in general"
* commit 'f3e4fda09106cb93bddea35a2cc7dbd4b2c281e9': Remove dependencies on runtime_libdvm and libdvm.so in general
This commit is contained in:
commit
4ae6a26719
@ -45,18 +45,21 @@ void DdmConnection::start(const char* name) {
|
|||||||
args.ignoreUnrecognized = JNI_FALSE;
|
args.ignoreUnrecognized = JNI_FALSE;
|
||||||
|
|
||||||
|
|
||||||
void* libdvm_dso = dlopen("libdvm.so", RTLD_NOW);
|
// TODO: Should this just link against libnativehelper and use its
|
||||||
ALOGE_IF(!libdvm_dso, "DdmConnection: %s", dlerror());
|
// 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);
|
void* libandroid_runtime_dso = dlopen("libandroid_runtime.so", RTLD_NOW);
|
||||||
ALOGE_IF(!libandroid_runtime_dso, "DdmConnection: %s", dlerror());
|
ALOGE_IF(!libandroid_runtime_dso, "DdmConnection: %s", dlerror());
|
||||||
|
|
||||||
if (!libdvm_dso || !libandroid_runtime_dso) {
|
if (!libart_dso || !libandroid_runtime_dso) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
jint (*JNI_CreateJavaVM)(JavaVM** p_vm, JNIEnv** p_env, void* vm_args);
|
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());
|
ALOGE_IF(!JNI_CreateJavaVM, "DdmConnection: %s", dlerror());
|
||||||
|
|
||||||
jint (*registerNatives)(JNIEnv* env, jclass clazz);
|
jint (*registerNatives)(JNIEnv* env, jclass clazz);
|
||||||
@ -104,8 +107,8 @@ error:
|
|||||||
if (libandroid_runtime_dso) {
|
if (libandroid_runtime_dso) {
|
||||||
dlclose(libandroid_runtime_dso);
|
dlclose(libandroid_runtime_dso);
|
||||||
}
|
}
|
||||||
if (libdvm_dso) {
|
if (libart_dso) {
|
||||||
dlclose(libdvm_dso);
|
dlclose(libart_dso);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user