summaryrefslogtreecommitdiff
path: root/src/runtime.cc
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2011-08-18 15:58:49 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-08-18 15:58:49 -0700
commit2cfd15d1940c848fd60b454c545a33e2a78d185e (patch)
tree7bb234b295ff13a8554db38f6acabc06d40c65ca /src/runtime.cc
parent1c332df048f796ad0656644cb0433bd6e7a49aa3 (diff)
parent18c0753c1659629021b4becdaa3f6ea81aecce35 (diff)
Merge "Initialize the rest of libcore's native code." into dalvik-dev
Diffstat (limited to 'src/runtime.cc')
-rw-r--r--src/runtime.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime.cc b/src/runtime.cc
index 335396d2ae..864b257c3c 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7,6 +7,7 @@
#include <limits>
#include <vector>
+#include "JniConstants.h"
#include "class_linker.h"
#include "heap.h"
#include "jni_internal.h"
@@ -312,7 +313,12 @@ Runtime* Runtime::Create(const Options& options, bool ignore_unrecognized) {
// Most JNI libraries can just use System.loadLibrary, but you can't
// if you're the library that implements System.loadLibrary!
+ Thread* self = Thread::Current();
+ Thread::State old_state = self->GetState();
+ self->SetState(Thread::kNative);
+ JniConstants::init(self->GetJniEnv());
LoadJniLibrary(instance_->GetJavaVM(), "javacore");
+ self->SetState(old_state);
return instance_;
}