Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / library / wearlink / AGENTS.md

AGENTS.md2.3 KiBRenderedCodeRaw
1# AGENTS.md โ€” library/wearlink/ (':library:wearlink')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply.
4
5- Gradle: :library:wearlink / dir: library/wearlink/
6- Package: `com.vayunmathur.library.wearlink` for the transport, plus one
7 per-app protocol subpackage (e.g. `com.vayunmathur.library.wearlink.clock`)
8- Entry: `WearLinkNode.kt` (Android), `WearLinkProtocol.kt` (pure wire),
9 `conduit/WearLinkClientNode.kt` (Messenger client used by every app
10 except the Watch apps)
11- Wear entry shell: `WearShellActivity.kt` โ€” every wear companion's main
12 activity extends `WearShellActivity<route, store>` (`createStore()`
13 warm-up, Wear Material theme + route state held in the shell; no
14 permission request โ€” the Watch conduit owns Bluetooth); each wear
15 module keeps its concrete activity name, route type and screen `when`.
16
17## Purpose
18First-party replacement for the proprietary Play-services Wearable Data
19Layer. RFCOMM over already-bonded Bluetooth, both sides listen + dial,
20cert-bound handshake. No Play services, no BLE scan/advertise, no location.
21
22Also hosts the shared phone<->wear wire protocols that were previously
23duplicated per app pair: each migrated protocol lives in
24`com.vayunmathur.library.wearlink.<app>` and is consumed by both the phone
25and wear app modules (which may not depend on each other). Golden-JSON
26tests stay in each app module and pin the shared code's wire format.
27Migrated: clock, launcher, calendar, weather, music, notes, maps, appstore, contacts, findfamily, todo, communicate, camera. Remaining pairs are listed in
28`docs/structure/wear-protocol-pairs.tsv`.
29
30The `conduit/` package is the Watch conduit contract and core:
31`ConduitProtocol` (Messenger codes/keys), `ConduitRouter` (pure
32routing: registrations, latest-data replay, bounded queue for
33unregistered apps, status fan-out, counters), `WearLinkClientNode`
34(drop-in `WearLinkNode` replacement over the conduit binding; reports
35`NotInstalled`/`Unavailable` when the Watch app is absent), and
36`ConduitHost`/`ConduitRuntime` used by the two Watch apps'
37`ConduitService`s. Merged phone/watch pairs ship as single APKs whose phone and watch
38experiences pick their side at runtime. This module declares no
39Bluetooth permissions; only the Watch apps (:watch, :watch:wear) do.
40
41## Verify
42```
43./gradlew :library:wearlink:testDebugUnitTest
44./gradlew :library:wearlink:lint
45```