MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / cache_classloader_of

Function cache_classloader_of

rust/src/api_tweaks/android.rs:58–73  ·  view source on GitHub ↗
(env: *mut JNIEnv, obj: jobject)

Source from the content-addressed store, hash-verified

56}
57
58pub(crate) fn cache_classloader_of(env: *mut JNIEnv, obj: jobject) -> errors::Result<()> {
59 unsafe {
60 let classloader_instance = (opt_to_res(cache::get_jni_call_object_method())?)(
61 env,
62 obj,
63 cache::get_get_classloader_method()?,
64 );
65 let mut g = CLASSLOADER.lock().unwrap();
66 let classloader_instance = jni_utils::create_global_ref_from_local_ref(classloader_instance, env)?;
67
68 *g = Some(J4rsAndroidClassloader {
69 class_loader: classloader_instance,
70 });
71 Ok(())
72 }
73}
74
75pub(crate) fn create_java_vm(
76 _jvm: *mut *mut JavaVM,

Callers

nothing calls this directly

Calls 4

opt_to_resFunction · 0.85

Tested by

no test coverage detected