docs(android): describe the live wallet-child poller (#134)
main merged the APK loop that paints with wallet_status then probes with wallet_child_refresh. Rebase onto that and write the loop as it ships.
This commit is contained in:
parent
e2c77da6bc
commit
da70f9b32d
2 changed files with 29 additions and 21 deletions
|
|
@ -251,17 +251,26 @@ in-process daemon, the chain probe fails, and the state stays `syncing`.
|
|||
|
||||
### What the APK refresh loop actually calls
|
||||
|
||||
`WireViewModel.openWalletChild()` polls every 2 s
|
||||
(`WALLET_CHILD_TICK_MS = 2_000`). Each tick is `Wire.walletStatus()` — the
|
||||
cached, non-dialing UniFFI read (`Wire::wallet_status`). It never spawns and
|
||||
it never probes the daemon, so `sync h/t` only moves when something else
|
||||
wrote a fresh snapshot (start, a previous live probe).
|
||||
`WireViewModel.openWalletChild()` runs `walletChildRefreshLoop` with a 2 s
|
||||
tick (`WALLET_CHILD_TICK_MS = 2_000`):
|
||||
|
||||
The SDK also exposes `Wire.walletChildRefresh()` (`Wire::wallet_child_refresh`):
|
||||
a live probe of the loopback wallet RPC, and of the local daemon's `get_info`
|
||||
when that RPC does not answer. The TUI uses it. **This APK's poller does not.**
|
||||
Do not read the moving `sync h/t` docs in [docs/WALLET.md](../docs/WALLET.md)
|
||||
as a description of the Android loop on this tree.
|
||||
1. **First paint** — `paintWalletChildCached()` → `Wire.walletStatus()`
|
||||
(`Wire::wallet_status`). Cached, no dial, so the screen has a record
|
||||
while the first probe is still in flight.
|
||||
2. **Every tick after that** — `refreshWalletChild()` →
|
||||
`Wire.walletChildRefresh()` (`Wire::wallet_child_refresh`). That dials
|
||||
the child's loopback wallet RPC, and the configured local daemon's
|
||||
`get_info` when the wallet RPC does not answer, which is what makes
|
||||
`sync h/t` move without another Start. It never spawns a child. With no
|
||||
live child the core short-circuits to the cached `off` / `exited`
|
||||
snapshot, so this cannot invent `ready`.
|
||||
|
||||
The loop suspends on each read before it sleeps: a probe slower than 2 s
|
||||
delays the next tick instead of overlapping it. Do not run two concurrent
|
||||
`wallet_child_refresh` calls against one child.
|
||||
|
||||
See [docs/WALLET.md](../docs/WALLET.md) (Android / SDK) for the same two
|
||||
methods as the UniFFI surface.
|
||||
|
||||
## CI and releases
|
||||
|
||||
|
|
@ -373,7 +382,7 @@ android/
|
|||
RotateScreen.kt
|
||||
Insets.kt
|
||||
Theme.kt
|
||||
src/test/ # JVM: envelope, store, invite, outbox, keepalive, wallet line
|
||||
src/test/ # JVM: envelope, store, invite, outbox, keepalive, wallet line, refresh loop
|
||||
src/androidTest/ # device-only: AndroidKeyStore
|
||||
src/main/jniLibs/arm64-v8a/libmonerowalletrpc.so
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue