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

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

AGENTS.md1.8 KiBRenderedCodeRaw
1# AGENTS.md — library/downloadservice/ (':library:downloadservice')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/downloadservice/` + allowed shared modules. Do not root-scan.
4
5- Gradle: :library:downloadservice / dir: library/downloadservice/
6- Package roots present: (foreground-download helpers — one package)
7- Entry files: InitialDownloader.kt (no MainActivity/Route — library)
8- Deps: :library (permission-free edge; WorkManager comes from
9 androidx.work directly — the `:library:work` helpers schedule that module's
10 own reminders, nothing reusable here)
11- Metadata: metadata_data/library-downloadservice.md (absent — libraries have none by design)
12- Rust: no / screenshotTest: no
13
14## Overview
15**Purpose:** Foreground downloads for large assets/models (ML weights, offline DBs) — declares INTERNET itself so consumers don't have to. Used by speech/translate (models), networklocation (beacon DBs).
16**How to use:** `InitialDownloader`/`InitialModelDownloadChecker` for first-run gates (file lists live in the consumer's `platform/` or `data/`); `ModelDownloadWorker` for WorkManager-driven fetches; URLs in `ModelUrls`.
17**Entry points:** `InitialDownloader.kt` → `ModelUrls.kt` → `ModelDownloadWorker.kt`.
18**Gotchas:** On-device paths are `/storage/emulated/0/Android/data/<pkg>/files/<fileName>` (`+.part` while downloading) — never hardcode, resolve per hosting app (libraries have no `applicationId`).
19
20## Key files
21- com/vayunmathur/library/downloadservice/InitialDownloader.kt
22- com/vayunmathur/library/downloadservice/ModelDownloadWorker.kt
23- com/vayunmathur/library/downloadservice/ModelUrls.kt
24
25## Verify (this module only)
26```
27./gradlew :library:downloadservice:compileDevKotlin
28./gradlew :library:downloadservice:lint
29```