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

Modern-Apps.git / screentime / AGENTS.md

AGENTS.md3.2 KiBRenderedCodeRaw
1# AGENTS.md — screentime/ (':screentime')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `screentime/` + allowed shared modules. Do not root-scan.
4
5_Install: ./install screentime (dev by default)._
6<!-- last-reviewed: 2026-10-16 -->
7- Gradle: :screentime / dir: screentime/
8- Package roots present: ui, data, domain, platform, service, widget, notifications
9- Entry files: ui/DashboardActivity.kt (activity-entry OS module; no MainActivity/Route)
10- Deps: :library:room, :library:widgets
11- Metadata: metadata_data/screentime.md (present)
12- Rust: no / screenshotTest: no
13
14## Overview
15**Purpose:** On-device screen-time dashboard — per-app usage, app timers + instant pauses, Wind Down (grayscale + DND), friction nudges, Glance widget. Sibling of `parentalcontrols/` (self-control vs supervised control). No account, nothing uploaded.
16**Key features:** `platform/UsageHistory` + `domain/HourBuckets` feed dashboard/charts; `AppTimers`/`Suspender`/`Coordinator` enforce limits; `WindDownApplier` + `WindowScheduler` run bedtime; widget mirrors the dashboard.
17**Entry points:** `ui/DashboardActivity.kt` → `ui/DashboardScreen.kt` → `platform/ScreenTimeViewModel.kt` → `platform/Coordinator.kt` → `data/Rules.kt`.
18**Gotchas:**
19- `receiver/` is NOT a closed package root — pending migration; don't add more files there
20- Usage access is a special grant — behavior without it is an empty dashboard, not an error; handle gracefully
21- Screenshot tests are off (`screenshotTest: no`) — verify timers/pause flows on device
22
23## Key files
24### data/ + domain/ — rules + buckets
25- com/vayunmathur/screentime/data/ScreenTimeDatabase.kt
26- com/vayunmathur/screentime/data/Rules.kt
27- com/vayunmathur/screentime/data/Migrations.kt
28- com/vayunmathur/screentime/domain/HourBuckets.kt
29### platform/ — coordination + enforcement
30- com/vayunmathur/screentime/platform/Coordinator.kt
31- com/vayunmathur/screentime/platform/ScreenTimeViewModel.kt
32- com/vayunmathur/screentime/platform/AppTimers.kt
33- com/vayunmathur/screentime/platform/Suspender.kt
34- com/vayunmathur/screentime/platform/UsageAccess.kt
35- com/vayunmathur/screentime/platform/UsageHistory.kt
36- com/vayunmathur/screentime/platform/WindDownApplier.kt
37- com/vayunmathur/screentime/platform/WindowScheduler.kt
38- com/vayunmathur/screentime/platform/DndState.kt
39### receiver/ + service/ — system bridges
40- com/vayunmathur/screentime/receiver/Receivers.kt
41- com/vayunmathur/screentime/service/Services.kt
42### ui/ + widget/ — dashboard + widget (the entries)
43- com/vayunmathur/screentime/ui/DashboardActivity.kt
44- com/vayunmathur/screentime/ui/DashboardScreen.kt
45- com/vayunmathur/screentime/ui/AppDetailsScreen.kt
46- com/vayunmathur/screentime/ui/FocusScreen.kt
47- com/vayunmathur/screentime/ui/FrictionScreen.kt
48- com/vayunmathur/screentime/ui/WindDownScreen.kt
49- com/vayunmathur/screentime/ui/UsageBarChart.kt
50- com/vayunmathur/screentime/ui/UsageFormat.kt
51- com/vayunmathur/screentime/ui/AppIconImage.kt
52- com/vayunmathur/screentime/widget/ScreenTimeGlanceWidget.kt
53- com/vayunmathur/screentime/widget/ScreenTimeWidgetReceiver.kt
54
55## Verify (this module only)
56```
57./gradlew :screentime:compileDevKotlin
58./gradlew :screentime:lint
59./gradlew :screentime:checkMetadata
60```