Index: net/test/android/net_test_entry_point.cc |
diff --git a/net/test/android/net_test_entry_point.cc b/net/test/android/net_test_entry_point.cc |
index c7a2dde0545fc40cc8a2aa6d082d43052d4baf90..fa324cbcdd67b62476cb9cc758f0d5300dc251fb 100644 |
--- a/net/test/android/net_test_entry_point.cc |
+++ b/net/test/android/net_test_entry_point.cc |
@@ -7,7 +7,10 @@ |
// This is called by the VM when the shared library is first loaded. |
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
- if (!net::test::OnJNIOnLoadRegisterJNI(vm) || !net::test::OnJNIOnLoadInit()) { |
+ base::android::InitVM(vm); |
+ JNIEnv* env = base::android::AttachCurrentThread(); |
+ if (!net::test::OnJNIOnLoadRegisterJNI(env) || |
+ !net::test::OnJNIOnLoadInit()) { |
return -1; |
} |
return JNI_VERSION_1_4; |