Revert^2 "Support using opaque JNI ids"

We weren't handing the fact that encoding jmethodIDs could cause OOM
exceptions in some places in reflection.cc. This could lead to
attempting to use a null jmethodID as if it were a real id. This issue
is fixed by the parent CL.

This reverts commit b476a29a2c.
This reverts commit 3b2905366c.
This Unreverts commit d5d645ffec.
This Unreverts commit 21d5994583.

Reason for revert: Fixed issue causing 004 debuggable flakes
Test: ./test.py --host --jit --debuggable
Bug: 134162467

Change-Id: Iece08ab299cd8a20f8382be7be6c3796858e70eb
diff --git a/openjdkjvmti/ti_heap.cc b/openjdkjvmti/ti_heap.cc
index 3d99ed8..898363a 100644
--- a/openjdkjvmti/ti_heap.cc
+++ b/openjdkjvmti/ti_heap.cc
@@ -21,12 +21,15 @@
 #include "base/macros.h"
 #include "base/mutex.h"
 #include "class_linker.h"
+#include "class_root.h"
 #include "dex/primitive.h"
 #include "gc/heap-visit-objects-inl.h"
 #include "gc/heap.h"
 #include "gc_root-inl.h"
+#include "handle_scope.h"
 #include "java_frame_root_info.h"
 #include "jni/jni_env_ext.h"
+#include "jni/jni_id_manager.h"
 #include "jni/jni_internal.h"
 #include "jvmti_weak_table-inl.h"
 #include "mirror/class.h"
@@ -36,9 +39,11 @@
 #include "object_tagging.h"
 #include "runtime.h"
 #include "scoped_thread_state_change-inl.h"
+#include "scoped_thread_state_change.h"
 #include "stack.h"
 #include "thread-inl.h"
 #include "thread_list.h"
+#include "well_known_classes.h"
 
 namespace openjdkjvmti {
 
@@ -1378,6 +1383,7 @@
   }
   {
     art::ScopedObjectAccess soa(self);      // Now we know we have the shared lock.
+    art::jni::ScopedEnableSuspendAllJniIdQueries sjni;  // make sure we can get JNI ids.
     art::ScopedThreadSuspension sts(self, art::kWaitingForVisitObjects);
     art::ScopedSuspendAll ssa("FollowReferences");