feat(android): keep the onion published through Doze with a foreground service
WireViewModel owned the single Wire node and called shutdown() from onCleared(), so a backgrounded node died with the UI. Node lifetime is now arbitrated by a pure policy (NodeLifetime) with two anchors — UI and keep-alive — and one process-wide owner (NodeHost) that is the only caller of flush()/shutdown() in the app. KeepAliveService holds the process in the foreground behind an ongoing notification from the "keep-alive" channel, started on unlock and stopped by Lock or the notification action, so peers can still reach the device while the screen is off. - foregroundServiceType="specialUse": dataSync is documented as a finite transfer (upload/download/backup) and this is an always-on node - POST_NOTIFICATIONS requested when the node becomes reachable; denial keeps the service running with no visible notice instead of failing - re-unlock with a node the service kept alive adopts it rather than reopening the store the live node still holds - 9 device-free unit tests for the start/stop/re-unlock state machine
This commit is contained in:
parent
48c06df2cf
commit
e923e06891
11 changed files with 814 additions and 87 deletions
|
|
@ -1,4 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">OnionWire</string>
|
||||
|
||||
<!--
|
||||
Foreground keep-alive. The notification text is the only place the user
|
||||
can see what is still running once the screen is off, so it names the
|
||||
moving parts instead of saying "running in the background".
|
||||
-->
|
||||
<string name="keep_alive_channel_name">Node keep-alive</string>
|
||||
<string name="keep_alive_channel_description">Shown while OnionWire keeps your onion address reachable in the background.</string>
|
||||
<string name="keep_alive_title">OnionWire is reachable</string>
|
||||
<string name="keep_alive_text">Tor and the outbox are running so peers can deliver messages.</string>
|
||||
<string name="keep_alive_text_onion">Tor and the outbox are running so peers can reach %1$s…</string>
|
||||
<string name="keep_alive_stop">Stop keep-alive</string>
|
||||
<string name="keep_alive_note_off">Reachable only while this app is open.</string>
|
||||
<string name="keep_alive_note_on">Kept alive — Tor and the outbox run until you tap Lock.</string>
|
||||
<string name="keep_alive_note_hidden">Kept alive, but notifications are blocked, so the status notice is hidden. Android still lists the service in the Task Manager.</string>
|
||||
<string name="keep_alive_note_unavailable">Not kept alive (%1$s). The node stops when the app does.</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Reference in a new issue