ART: Move JniConstants::init from ART to libcore
This should live with libcore. There's no deep magic in the runtime
startup.
Also remove dependency on libnativehelper shared library.
Bug: 65522645
Test: m
Test: m test-art-host
Test: Device boots (bullhead)
Change-Id: I6d03144fa02461d31e9e26c27cdb3a9a9510122d
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 47f033f..9d16f57 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -134,8 +134,6 @@
#include "native/sun_misc_Unsafe.h"
#include "native_bridge_art_interface.h"
#include "native_stack_dump.h"
-#include "nativehelper/JniConstants.h"
-#include "nativehelper/JniConstants-priv.h"
#include "nativehelper/scoped_local_ref.h"
#include "oat_file.h"
#include "oat_file_manager.h"
@@ -412,10 +410,6 @@
// instance. We rely on a small initialization order issue in Runtime::Start() that requires
// elements of WellKnownClasses to be null, see b/65500943.
WellKnownClasses::Clear();
-
- // Ensure that libnativehelper caching is invalidated, in case a new runtime is to be brought
- // up later.
- android::ClearJniConstantsCache();
}
struct AbortState {
@@ -1553,11 +1547,7 @@
// Must be in the kNative state for calling native methods (JNI_OnLoad code).
CHECK_EQ(self->GetState(), kNative);
- // First set up JniConstants, which is used by both the runtime's built-in native
- // methods and libcore.
- JniConstants::init(env);
-
- // Then set up the native methods provided by the runtime itself.
+ // Set up the native methods provided by the runtime itself.
RegisterRuntimeNativeMethods(env);
// Initialize classes used in JNI. The initialization requires runtime native