ffi 1.29: retire the C sx_android_query_safe_insets body

Closes the Phase 1D migration for the safe-insets JNI chain. The C
function and its `#foreign` declaration in `android.sx` are gone;
all dispatch now goes through the sx-side `#jni_call` machinery
plus the JavaVM helpers landed in 1.26.

What's gone from `library/vendors/sx_android_jni/sx_android_jni.c`:
- `#include <android/native_activity.h>` and `<jni.h>` (no longer
  needed without the JNI body).
- `sx_android_query_safe_insets` — 55 lines of `(*env)->Foo` chain
  with manual `goto done` early-exit. Migrated to
  `library/modules/platform/android.sx::sx_query_safe_insets_jni`
  in 1.25 (15 lines of `#jni_call`).

What stays:
- `sx_android_install_input_handler` — non-JNI; struct-field
  assignment against `struct android_app`'s `onInputEvent` slot.
  No sx equivalent yet (would need to either land a `#android_app`-
  style intrinsic or hand-roll the offset, neither of which is
  Phase 1 scope).
- `<android/input.h>` and the `struct sx_android_app_min` mirror
  needed by the input-handler installer.

Net diff: -55 lines in the .c file, -1 line `#foreign` decl in
android.sx. Phase 2 (declarative JNI imports) will revisit whether
the .c file can be deleted entirely (the input-handler hop may
move into a different shape).

Verification:
- zig build + zig test + run_examples + cross_compile all green.
  Notable: the previously-failing `ffi-objc-call-12-rect-u64-returns`
  also passes now — looks like the working-tree `#import c` work
  was tidied up alongside.
- chess Android APK rebuilt + reinstalled + launched on Pixel
  device; safe-insets behavior unchanged (board top edge sits below
  the status bar correctly, all pieces in starting positions, no
  status-bar overlap).
This commit is contained in:
agra
2026-05-19 23:13:51 +03:00
parent 6e65324f44
commit 4ddee931b5
2 changed files with 12 additions and 69 deletions

View File

@@ -51,8 +51,11 @@ AMotionEvent_getAction :: (event: *void) -> s32 #foreign;
AMotionEvent_getX :: (event: *void, pointer_index: u64) -> f32 #foreign;
AMotionEvent_getY :: (event: *void, pointer_index: u64) -> f32 #foreign;
// JNI/glue bridges from vendors/sx_android_jni/sx_android_jni.c.
sx_android_query_safe_insets :: (activity: *void, top: *s32, left: *s32, bottom: *s32, right: *s32) -> void #foreign;
// Glue bridge from vendors/sx_android_jni/sx_android_jni.c. The
// safe-insets JNI chain that used to live in that file was migrated
// to sx (see `sx_query_safe_insets_jni` below) — what remains is the
// input-handler installer, which is plain struct-field plumbing
// rather than JNI dispatch.
sx_android_install_input_handler :: (app: *void, handler: (*void, *void) -> s32) -> void #foreign;
// JavaVM vtable indirection — used to attach the calling thread to