itsgoin/crates/tauri-app/gen/android
Scott Reimers bbc17f8855 fix(android): close button now actually stops the node service
The close button called stopService() and then app.exit(0) immediately.
stopService() is asynchronous — it posts to ActivityManager and onDestroy
runs later on the main thread — so the process often died mid-flight.
Android saw a foreground service whose process had died and, per
onStartCommand returning START_STICKY, restarted it. Whether the clean
path won was pure timing, which is why this worked when v0.7.3 shipped
and stopped working under v0.8's heavier startup and shutdown.

Nothing in gen/android had changed since v0.7.3 (verified: the diff is
empty) — this was a latent race, not a regression.

Fix, in two layers:
- NodeService persists a user_quit flag to SharedPreferences (commit(),
  not apply(), since the process may die moments later). stopFromNative
  sets it BEFORE calling stopService. onStartCommand treats a null intent
  as "Android resurrected me" and, if the flag is set, calls
  stopForeground(STOP_FOREGROUND_REMOVE) + stopSelf() and returns
  START_NOT_STICKY. MainActivity clears the flag on genuine launch, so a
  system-initiated kill still resumes via START_STICKY — the case that
  behaviour exists for.
- exit_app awaits 400ms between the stop and app.exit(0) so the clean
  path usually wins; the persisted flag is the backstop when it doesn't.

Not rebuilt — batching for 0.8.1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LGiPD2cF75mnvneSCjdDC5
2026-08-06 23:54:00 -04:00
..
app fix(android): close button now actually stops the node service 2026-08-06 23:54:00 -04:00
buildSrc ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
gradle/wrapper ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
.editorconfig ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
.gitignore ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
build.gradle.kts ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
gradle.properties ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
gradlew ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
gradlew.bat ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
settings.gradle ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00