ReviewOS

also looking at this

craft-native/craft

feat(android): getNetworkStatus — the action iOS cannot serve

#146
Merged glennmichael123 wants to merge feat/android-network-status into main
7 files +407 -3
packages/zig/src/jni_runtime.zigmodified+10-0
Changes to packages/zig/src/jni_runtime.zig
@@ -624,6 +624,16 @@ pub const Jni = struct {
624624 return result;
625625 }
626626
627 pub fn callBooleanMethodA(self: Self, obj: jobject, id: jmethodID, args: []const jvalue) JniError!bool {
628 const call: *const fn (JNIEnv, jobject, jmethodID, [*]const jvalue) callconv(.c) jboolean =
629 @ptrCast(self.table().CallBooleanMethodA orelse return JniError.NotFound);
630 const result = call(self.env, obj, id, args.ptr);
631 try self.check();
632 // `jboolean` is a `u8` and the JVM only ever sets it to 0 or 1, but a
633 // `!= 0` rather than `== 1` is what the spec licenses.
634 return result != JNI_FALSE;
635 }
636
627637 pub fn callVoidMethodA(self: Self, obj: jobject, id: jmethodID, args: []const jvalue) JniError!void {
628638 const call: *const fn (JNIEnv, jobject, jmethodID, [*]const jvalue) callconv(.c) void =
629639 @ptrCast(self.table().CallVoidMethodA orelse return JniError.NotFound);