Merge "Check whether kernel is for X86 via JNI" into main

This commit is contained in:
Maciej Żenczykowski 2024-02-10 05:22:15 +00:00 • committed by Gerrit Code Review
commit ec3b193377
2 changed files with 8 additions and 0 deletions

View file

@ -255,6 +255,10 @@ static jboolean android_net_utils_isKernel64Bit(JNIEnv *env, jclass clazz) {
return bpf::isKernel64Bit();
}
static jboolean android_net_utils_isKernelX86(JNIEnv *env, jclass clazz) {
return bpf::isX86();
}
// ----------------------------------------------------------------------------
/*
@ -278,6 +282,7 @@ static const JNINativeMethod gNetworkUtilMethods[] = {
{ "setsockoptBytes", "(Ljava/io/FileDescriptor;II[B)V",
(void*) android_net_utils_setsockoptBytes},
{ "isKernel64Bit", "()Z", (void*) android_net_utils_isKernel64Bit },
{ "isKernelX86", "()Z", (void*) android_net_utils_isKernelX86 },
};
// clang-format on

View file

@ -440,4 +440,7 @@ public class NetworkUtils {
/** Returns whether the Linux Kernel is 64 bit */
public static native boolean isKernel64Bit();
/** Returns whether the Linux Kernel is x86 */
public static native boolean isKernelX86();
}