ADR 0008: Tell shared modules which app they run in, not which device
Status: Accepted (2026-11-02, in #121)
Context
Section titled “Context”Some shared behaviour has to differ in the TV app:
- settings that make no sense on TV: gestures, trickplay until it exists, downloads (1-walkthrough.md, F7; ADR 0007);
- TV-only settings: seek steps (ADR 0004).
PlayerViewModel already has an isTv, but it reads it from the device (FEATURE_LEANBACK). That’s right for decoder choice, which depends on the hardware. It’s wrong for UI choices: the phone APK on a TV box would then hide phone settings that the phone UI does use.
Decision
Section titled “Decision”- Add a
@AppVariantvalue to the DI graph: an enumAppVariant { PHONE, TV }, provided by a small Hilt module in each app (app/phoneandapp/tv). It isn’t defined incore, so each APK states what it is. - Shared ViewModels that need it inject it (for example
SettingsViewModelfilters its tree with it). The default behaviour is the phone one, so phone doesn’t change (rule 9). FEATURE_LEANBACKstays the check for hardware questions (decoders, tunneling, refresh rate). The two questions are kept separate on purpose.
Consequences
Section titled “Consequences”- The settings tree gets a
variants(ortvOnly/phoneOnly) field per item instead ofifs spread around. Phone shows everything it shows today. - New shared features have to decide per variant. Add a line about this to
CLAUDE.mdonce the first change uses it.
Source: docs/tv-research/adr/0008-tv-flag-in-shared-modules.md · raw Markdown