Revert "Disable hidden API checks during WellKnownClasses::Init"
Bug: 64382372
Bug: 73114663
This reverts commit 8407b4eb191acb52d3e166347ad79069ac188aef.
Change-Id: I536a14adeae87790769931fe3a2f217ae1ec0d6b
diff --git a/runtime/well_known_classes.cc b/runtime/well_known_classes.cc
index f4f5420..5fe10f5 100644
--- a/runtime/well_known_classes.cc
+++ b/runtime/well_known_classes.cc
@@ -278,12 +278,6 @@
#undef STRING_INIT_LIST
void WellKnownClasses::Init(JNIEnv* env) {
- // The following initializers use JNI to get handles on hidden methods/fields.
- // Temporarily disable hidden API checks as they would see these calls coming
- // from an unattached thread and assume the caller is not in boot class path.
- const bool hidden_api_checks_enabled = Runtime::Current()->AreHiddenApiChecksEnabled();
- Runtime::Current()->SetHiddenApiChecksEnabled(false);
-
dalvik_annotation_optimization_CriticalNative =
CacheClass(env, "dalvik/annotation/optimization/CriticalNative");
dalvik_annotation_optimization_FastNative = CacheClass(env, "dalvik/annotation/optimization/FastNative");
@@ -407,9 +401,6 @@
InitStringInit(env);
Thread::Current()->InitStringEntryPoints();
-
- // Reenable hidden API checks if necessary.
- Runtime::Current()->SetHiddenApiChecksEnabled(hidden_api_checks_enabled);
}
void WellKnownClasses::LateInit(JNIEnv* env) {