OSDN Git Service

ART: Expose jni_binder's FindClass
authorAndreas Gampe <agampe@google.com>
Tue, 11 Apr 2017 04:09:13 +0000 (21:09 -0700)
committerAndreas Gampe <agampe@google.com>
Tue, 11 Apr 2017 04:09:13 +0000 (21:09 -0700)
Required for the CTS agent.

Bug: 32072923
Test: m test-art-host
Change-Id: I37764b0646fdb0df7ec9dd544d1dffdc909e269b

test/ti-agent/jni_binder.cc
test/ti-agent/jni_binder.h

index b66c2c7..32236de 100644 (file)
@@ -174,12 +174,7 @@ static jclass FindClassWithClassLoader(JNIEnv* env, const char* class_name, jobj
                                                          class_loader));
 }
 
-// Find the given classname. First try the implied classloader, then the system classloader,
-// then use JVMTI to find all classloaders.
-static jclass FindClass(jvmtiEnv* jvmti_env,
-                        JNIEnv* env,
-                        const char* class_name,
-                        jobject class_loader) {
+jclass FindClass(jvmtiEnv* jvmti_env, JNIEnv* env, const char* class_name, jobject class_loader) {
   if (class_loader != nullptr) {
     return FindClassWithClassLoader(env, class_name, class_loader);
   }
index 6f96257..e998dc5 100644 (file)
 
 namespace art {
 
+// Find the given classname. First try the implied classloader, then the system classloader,
+// then use JVMTI to find all classloaders.
+jclass FindClass(jvmtiEnv* jvmti_env, JNIEnv* env, const char* class_name, jobject class_loader);
+
 // Load the class through JNI. Inspect it, find all native methods. Construct the corresponding
 // mangled name, run dlsym and bind the method.
 //