diff options
| author | 2016-04-21 16:01:24 -0700 | |
|---|---|---|
| committer | 2016-04-25 11:01:49 -0700 | |
| commit | 041169f7ca703d560a819e7a568170731d4ecdd6 (patch) | |
| tree | 9184a7a5f74779787c897093428a58e4f1d19239 /runtime/java_vm_ext.cc | |
| parent | 2712a078c74050f787900765830f7f33d8bd75e6 (diff) | |
Initialize native loader on JNI_CreateJavaVM
We need to initialize native loader in order to
be able to use JNI from any VM, be it dalvikvm
or VM started by zygote.
Bug: http://b/28082914
Bug: http://b/28320913
Change-Id: Ice9a33a736d7c6ec3af9a5a0fb25a378ad9d2c59
Diffstat (limited to 'runtime/java_vm_ext.cc')
| -rw-r--r-- | runtime/java_vm_ext.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc index a41fd45041..35bb3c3301 100644 --- a/runtime/java_vm_ext.cc +++ b/runtime/java_vm_ext.cc @@ -950,6 +950,11 @@ extern "C" jint JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args) { LOG(WARNING) << "CreateJavaVM failed"; return JNI_ERR; } + + // Initialize native loader. This step makes sure we have + // everything set up before we start using JNI. + android::InitializeNativeLoader(); + *p_env = Thread::Current()->GetJniEnv(); *p_vm = runtime->GetJavaVM(); return JNI_OK; |