MCPcopy Create free account
hub / github.com/antvis/F2Native / JNI_OnLoad

Function JNI_OnLoad

core/android/F2NativeJNI.cpp:954–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952} // namespace xg
953
954JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) {
955 F2_LOG_I("#JNI_OnLoad", "%s", "JNI_OnLoad Start...");
956 JavaVM *old = xg::jni::GetJVM();
957 if(old == vm) {
958 F2_LOG_I("#JNI_OnLoad", "%s", "JNI_OnLoad dupliation vm, skip OnLoad");
959 return JNI_VERSION_1_4;
960 }
961
962 xg::jni::InitJavaVM(vm);
963
964 JNIEnv *env = xg::jni::AttachCurrentThread();
965 F2_LOG_I("#JNI_OnLoad", "%s", "AttachCurrentThread FINISH");
966 bool result = xg::jni::OnJniLoad(env);
967
968 if(!result) {
969 F2_LOG_E("#JNI_OnLoad", "%s", "JNI_OnLoad FAIL");
970 }
971 return JNI_VERSION_1_4;
972}
973
974JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved) { F2_LOG_I("#JNI_OnUnload", "%s", "JNI_OnUnload Finished"); }

Callers

nothing calls this directly

Calls 4

GetJVMFunction · 0.85
InitJavaVMFunction · 0.85
AttachCurrentThreadFunction · 0.85
OnJniLoadFunction · 0.85

Tested by

no test coverage detected