also looking at this
feat(android): getNetworkStatus — the action iOS cannot serve
#146
7 files
+407
-3
| @@ -624,6 +624,16 @@ pub const Jni = struct { | ||
| 624 | 624 | return result; |
| 625 | 625 | } |
| 626 | 626 | |
| 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 | ||
| 627 | 637 | pub fn callVoidMethodA(self: Self, obj: jobject, id: jmethodID, args: []const jvalue) JniError!void { |
| 628 | 638 | const call: *const fn (JNIEnv, jobject, jmethodID, [*]const jvalue) callconv(.c) void = |
| 629 | 639 | @ptrCast(self.table().CallVoidMethodA orelse return JniError.NotFound); |