also looking at this
feat(android): the reply channel, so async actions become reachable
#152
5 files
+464
-0
| @@ -44,6 +44,7 @@ const network = @import("bridge_android_network.zig"); | ||
| 44 | 44 | const securestore = @import("bridge_android_securestore.zig"); |
| 45 | 45 | const haptics = @import("bridge_android_haptics.zig"); |
| 46 | 46 | const notifcancel = @import("bridge_android_notifcancel.zig"); |
| 47 | const events = @import("android_events.zig"); | |
| 47 | 48 | |
| 48 | 49 | const Jni = jni.Jni; |
| 49 | 50 | |
| @@ -96,6 +97,10 @@ pub const holder_class = "com/craft/runtime/CraftNative"; | ||
| 96 | 97 | /// linked. |
| 97 | 98 | pub export fn JNI_OnLoad(vm_handle: jni.JavaVM, _: ?*anyopaque) callconv(.c) jni.jint { |
| 98 | 99 | java_vm = vm_handle; |
| 100 | // The reply channel needs the same handle, and needs it before any action | |
| 101 | // runs: a callback that fires between load and the first native call has | |
| 102 | // nowhere to deliver otherwise. | |
| 103 | events.setVm(vm_handle); | |
| 99 | 104 | |
| 100 | 105 | switch (bindNatives(vm_handle)) { |
| 101 | 106 | .registered => {}, |