Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / watch-wear / AGENTS.md
| 1 | # AGENTS.md — watch-wear/ (':watch:wear') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside |
| 4 | > `watch-wear/` + `watch/` (the phone side of the same app). |
| 5 | |
| 6 | - Gradle: :watch:wear (dir watch-wear/) / dir: watch-wear/ (convention: `common-conventions-wear`) |
| 7 | - Package roots present: ui, platform, service |
| 8 | - Entry file: ui/WearMainActivity.kt |
| 9 | |
| 10 | ## Why this module exists (read before changing identity) |
| 11 | Watch half of the Watch conduit — the sole phone<->watch messaging |
| 12 | app on the watch. It deliberately uses |
| 13 | `applicationId = "com.vayunmathur.watch"` (the phone app's) with the |
| 14 | shared dev/release signing: the WearLink handshake token and the |
| 15 | `com.vayunmathur.watch.permissions.CONDUIT` signature permission both |
| 16 | require the same signing certificate on both sides. It is the only |
| 17 | watch app that holds Bluetooth permissions and the only one that owns |
| 18 | a real `WearLinkNode` (appId `watch_conduit`, in |
| 19 | `service/ConduitService` via `ConduitHost` in `:library:wearlink`). |
| 20 | Every other watch app reaches the phone through `WearLinkClientNode`. |
| 21 | |
| 22 | ## Conduit |
| 23 | - Local clients: signature-permission Messenger bound service |
| 24 | (`service/ConduitService`, foreground `connectedDevice`), restarted |
| 25 | by `platform/BootReceiver` on boot/replacement. |
| 26 | - Routing/protocol: `com.vayunmathur.library.wearlink.conduit` in |
| 27 | `:library:wearlink`, shared with `:watch`; route key is the first |
| 28 | path segment. |
| 29 | - The status screen renders `ConduitRuntime.state` (link state, |
| 30 | registered apps, per-app counters). |
| 31 | - Inbound data items are mirrored to the host's persistent |
| 32 | latest-wins `ConduitDataStore` (in `:library:wearlink`), so a |
| 33 | snapshot pushed while a watch app is not running replays to it on |
| 34 | its next registration; watch-originated pushes to the phone land |
| 35 | the same way in the phone host's store. |
| 36 | |
| 37 | ## Verify (this module only) |
| 38 | ``` |
| 39 | ./gradlew :watch:wear:assembleDev |
| 40 | ./gradlew :watch:wear:testDebugUnitTest |
| 41 | ``` |