Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / cast / tv / AGENTS.md
| 1 | # AGENTS.md — cast/tv/ (':cast:tv') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `cast/tv/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | _Install: ./install cast/tv (dev by default)._ |
| 6 | <!-- last-reviewed: 2026-10-16 --> |
| 7 | - Gradle: :cast:tv / dir: cast/tv/ |
| 8 | - Package roots present: ui, platform, service |
| 9 | - Entry files: MainActivity.kt (receiver shell — NOT a phone app; no Route/Navigation, TV panel modes instead) |
| 10 | - Deps: :cast:protocol, :library:e2ee-p2p |
| 11 | - Metadata: metadata_data/cast-tv.md (present) |
| 12 | - Rust: no / screenshotTest: no |
| 13 | |
| 14 | ## Overview |
| 15 | **Purpose:** Android-TV receiver for the `cast/` sender — advertises, pairs, decodes and plays mirrored screen + handed-off media. Runs on TV, never evaluated as a phone app. |
| 16 | **Key features:** |
| 17 | - Receiver advertisement + pairing handshake (`ReceiverAdvertiser`, `ReceiverPairing`, `PairingStore`) against `:cast:protocol` |
| 18 | - Control channel + media loop (`ReceiverController`, `ReceiverMediaLoop`) feeding `ContentPlayer`/`AudioPlayer`/`VideoDecoder` with artwork fetch |
| 19 | - TV panel modes + transport overlay + now-playing UI (`PanelModes`, `TransportOverlay`, `NowPlaying`) |
| 20 | **Architecture / data-flow:** `service/ReceiverService` owns lifetime → `platform/ReceiverController` + `ControlChannel` → `ReceiverMediaLoop` → decoders/players → `ui/` TV surfaces; mirror input lands in `MirrorActivity`. |
| 21 | **Entry points + reading order:** `MainActivity.kt` → `service/ReceiverService.kt` → `platform/ReceiverController.kt` → `platform/ReceiverMediaLoop.kt` → `platform/ContentPlayer.kt`. |
| 22 | **Gotchas:** |
| 23 | - TV-only: no edge-to-edge phone chrome, D-pad focus matters, no touch assumptions |
| 24 | - Decoder capabilities feed back to the sender's codec negotiation — receiver bugs surface as sender quality drops |
| 25 | - Pairing store persists trust; clearing it force-drops all senders |
| 26 | |
| 27 | ## Key files |
| 28 | ### Root — receiver shell (no Route/Navigation) |
| 29 | - com/vayunmathur/cast/tv/MainActivity.kt |
| 30 | ### platform/ — receiver pipeline |
| 31 | - com/vayunmathur/cast/tv/platform/ReceiverController.kt |
| 32 | - com/vayunmathur/cast/tv/platform/ReceiverUiContract.kt |
| 33 | - com/vayunmathur/cast/tv/platform/ReceiverAdvertiser.kt |
| 34 | - com/vayunmathur/cast/tv/platform/ReceiverPairing.kt |
| 35 | - com/vayunmathur/cast/tv/platform/PairingStore.kt |
| 36 | - com/vayunmathur/cast/tv/platform/ControlChannel.kt |
| 37 | - com/vayunmathur/cast/tv/platform/ReceiverMediaLoop.kt |
| 38 | - com/vayunmathur/cast/tv/platform/ReceiverContentSession.kt |
| 39 | - com/vayunmathur/cast/tv/platform/MediaReceiver.kt |
| 40 | - com/vayunmathur/cast/tv/platform/ContentPlayer.kt |
| 41 | - com/vayunmathur/cast/tv/platform/AudioPlayer.kt |
| 42 | - com/vayunmathur/cast/tv/platform/VideoDecoder.kt |
| 43 | - com/vayunmathur/cast/tv/platform/ArtworkFetcher.kt |
| 44 | - com/vayunmathur/cast/tv/platform/MirrorActivity.kt |
| 45 | - com/vayunmathur/cast/tv/platform/PanelModes.kt |
| 46 | ### service/ — receiver lifetime |
| 47 | - com/vayunmathur/cast/tv/service/ReceiverService.kt |
| 48 | ### ui/ — TV surfaces (D-pad, not touch) |
| 49 | - com/vayunmathur/cast/tv/ui/ReceiverContent.kt |
| 50 | - com/vayunmathur/cast/tv/ui/NowPlaying.kt |
| 51 | - com/vayunmathur/cast/tv/ui/TransportOverlay.kt |
| 52 | - com/vayunmathur/cast/tv/ui/Theme.kt — TV receiver theme (not DynamicTheme) |
| 53 | |
| 54 | ## Verify (this module only) |
| 55 | ``` |
| 56 | ./gradlew :cast:tv:compileDevKotlin |
| 57 | ./gradlew :cast:tv:lint |
| 58 | ./gradlew :cast:tv:checkMetadata |
| 59 | ``` |