Pad/scripts
Greg Pomerantz 2bdff5c8e8 Flush the session snapshot on activity onStop (Android)
The OS provides no user-space hook for a process kill, but the
activity onStop fires on every 'going away' transition the framework
still controls: entering recents (the swipe-wipe path), app switch,
and home. Recents-wipe then kills the process right after onStop
returns, so that moment is the last reliable flush.

- Logic.FlushSession (any goroutine, buffered, non-blocking) ->
  flushSessionSave on the owner: persist the snapshot now, bypassing
  the rate limit (still honoring the restore-pending suppression).
  saveSessionIfChanged's persist tail is deduplicated into writeSession.
- JNI: GioActivity.onStop (patched into the smali by the build
  scripts, in sync) now calls the static native padFlushSession, which
  maps to the pad_flush_session cgo export.

Verified on emulator: the flush fires on home/app-switch and when the
app is backgrounded into recents before a kill; a state change made
inside the 250ms rate window and then backed out of the app persists
the latest position. A hard kill while foregrounded (force-stop,
memory pressure) still has no hook — the immediate edit saves plus the
250ms rate window bound that loss.
2026-08-20 18:24:43 -04:00
..
build_emu.sh Flush the session snapshot on activity onStop (Android) 2026-08-20 18:24:43 -04:00
build_phone.sh Flush the session snapshot on activity onStop (Android) 2026-08-20 18:24:43 -04:00
check.sh Handle drags: 1:1 finger tracking with cross-flip; fix caret/taps on empty lines 2026-08-19 22:34:12 -04:00
emu.sh doc: screen coordinate reference (screen vs display vs app-local px) 2026-08-16 22:19:40 -04:00
profile_emulator.sh Restrict the frame-regression release gate to the emulator 2026-08-20 14:40:24 -04:00
release.sh Make the release process script-driven and documented 2026-08-20 14:54:48 -04:00