android: third_party/jni_zero: Remove JNI functions

This commit is contained in:
klzgrad 2024-07-27 10:18:11 +08:00
parent 894b53ff5e
commit f83444ebd7
2 changed files with 1 additions and 43 deletions

View file

@ -8,29 +8,6 @@ config("jni_include_dir") {
include_dirs = [ jni_headers_dir ]
}
generate_jni("generate_jni") {
sources = [
"java/src/org/jni_zero/JniInit.java",
"java/src/org/jni_zero/JniUtil.java",
]
visibility = [
":*",
"//components/cronet/android/*",
]
}
generate_jar_jni("system_jni") {
classes = [
"java/util/Arrays.class",
"java/util/Collection.class",
"java/util/List.class",
"java/util/Map.class",
"java/lang/Integer.class",
"java/lang/Long.class",
"java/lang/Boolean.class",
]
visibility = [ ":*" ]
}
# This is the public target that we intend others to use.
component("jni_zero") {
@ -45,7 +22,6 @@ component("jni_zero") {
]
sources = [
"common_apis.cc",
"common_apis.h",
"default_conversions.cc",
"java_refs.cc",
@ -75,8 +51,6 @@ component("jni_zero") {
}
deps = [
":generate_jni($default_toolchain)",
":system_jni($default_toolchain)",
]
}

View file

@ -6,7 +6,6 @@
#include <sys/prctl.h>
#include "third_party/jni_zero/generate_jni/JniInit_jni.h"
#include "third_party/jni_zero/jni_methods.h"
#include "third_party/jni_zero/jni_zero_internal.h"
#include "third_party/jni_zero/logging.h"
@ -127,22 +126,7 @@ void InitVM(JavaVM* vm) {
JNIEnv* env = AttachCurrentThread();
g_object_class = GetSystemClassGlobalRef(env, "java/lang/Object");
g_string_class = GetSystemClassGlobalRef(env, "java/lang/String");
g_empty_string.Reset(
env, ScopedJavaLocalRef<jstring>(env, env->NewString(nullptr, 0)));
#if defined(JNI_ZERO_MULTIPLEXING_ENABLED)
Java_JniInit_crashIfMultiplexingMisaligned(env, kJniZeroHashWhole,
kJniZeroHashPriority);
#else
// Mark as used when multiplexing not enabled.
(void)&Java_JniInit_crashIfMultiplexingMisaligned;
#endif
ScopedJavaLocalRef<jobjectArray> globals = Java_JniInit_init(env);
g_empty_list.Reset(env,
ScopedJavaLocalRef<jobject>(
env, env->GetObjectArrayElement(globals.obj(), 0)));
g_empty_map.Reset(env,
ScopedJavaLocalRef<jobject>(
env, env->GetObjectArrayElement(globals.obj(), 1)));
CheckException(env);
}
void DisableJvmForTesting() {