mirror of
https://github.com/phantomptr/ps5upload.git
synced 2026-10-19 02:20:02 -05:00
bg_activity.rs polls the engine's /api/activity every second from Rust, so a hidden or frozen WebView no longer decides whether work is running or has ended. A pure step() turns each snapshot into start/update/finished/stop actions: the first poll only records seq, an engine restart resets it, a renderer hold refreshed within 5 minutes counts as work, and nothing active for 30 s stops. Finished jobs are emitted to the page (bg-job-finished, plus a bg-tick heartbeat while work runs) and announced through the OS when the app is in the background, in the language the page sends. Android: a connectedDevice foreground service (dataSync as fallback) with a partial wake lock and a Wi-Fi lock keeps the process and its in-process engine alive, with an ongoing progress notification and a separate result channel. The Kotlin class, manifest entries and R8 keep rules are written by android-postinit-patch.sh. JNI_OnLoad and the context helpers move to android_jni.rs so both callers share them; app classes load through the context's class loader. The mobile engine start is now once per process, as Activity recreation can run setup again. Desktop: notifications through the notification plugin's Rust API when the main window is hidden, minimised or unfocused; backgroundThrottling disabled on the window (macOS 14+). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K3cPwhp3UrzayBfyy9PDcN