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

Modern-Apps.git / networklocation / AGENTS.md

AGENTS.md3.0 KiBRenderedCodeRaw
1# AGENTS.md — networklocation/ (':networklocation')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `networklocation/` + allowed shared modules. Do not root-scan.
4
5_Install: ./install networklocation (dev by default)._
6<!-- last-reviewed: 2026-10-16 -->
7- Gradle: :networklocation / dir: networklocation/
8- Package roots present: provider
9- Entry files: MainActivity.kt (database-setup UI) + provider/LocationProviderImpl.kt (system provider entry)
10- Deps: :library:locationprovider, :library:downloadservice
11- Metadata: metadata_data/networklocation.md (present)
12- Rust: yes / screenshotTest: no
13
14## Overview
15**Purpose:** Privileged system network-location + geocoder provider — Wi-Fi/cell fixes without GPS and offline geocoding, solved on-device in Rust. Beacons never leave the phone; internet only for one-time offline-DB downloads.
16**Key features:** `provider/LocationProviderImpl` serves system fixes from `OfflineBeaconStore` (timed-LRU wifi/cell caches) over `NetworkLocationService`; `GeocodeService` resolves offline; `MainActivity` manages offline-DB state (`OfflineDatabases`).
17**Entry points:** `provider/LocationProviderImpl.kt` → `provider/OfflineBeaconStore.kt` → `NetworkLocationService.kt` → `NetworkLocationNative.kt` (Rust solver).
18**Gotchas:**
19- `cache/`, `cell/`, `wifi/` are NOT closed package roots — pending migration; don't add more files there
20- System-provider registration is signature/role-gated — sideloaded builds won't serve fixes
21- Beacon privacy is the product — never log or upload identifiers/positions
22
23## Key files
24### Root + provider/ — entries
25- com/vayunmathur/networklocation/MainActivity.kt — offline-DB setup UI
26- com/vayunmathur/networklocation/NetworkLocationService.kt
27- com/vayunmathur/networklocation/GeocodeService.kt
28- com/vayunmathur/networklocation/provider/LocationProviderImpl.kt — system entry
29- com/vayunmathur/networklocation/provider/OfflineBeaconStore.kt
30- com/vayunmathur/networklocation/provider/DatabaseStatusProvider.kt
31- com/vayunmathur/networklocation/provider/DatabaseStatusContract.kt
32- com/vayunmathur/networklocation/provider/LocationReportingTask.kt
33### Root — solver + stores (Rust bridges)
34- com/vayunmathur/networklocation/NetworkLocationNative.kt
35- com/vayunmathur/networklocation/GeocoderNative.kt
36- com/vayunmathur/networklocation/WpsStoreNative.kt
37- com/vayunmathur/networklocation/OfflineDatabases.kt
38- com/vayunmathur/networklocation/OfflineDatabaseSection.kt
39- com/vayunmathur/networklocation/PositioningData.kt
40- com/vayunmathur/networklocation/BeaconKeys.kt
41### cache/ + cell/ + wifi/ — beacon pipeline (pending migration to closed roots)
42- com/vayunmathur/networklocation/cache/BeaconCache.kt
43- com/vayunmathur/networklocation/cache/TimedLruCache.kt
44- com/vayunmathur/networklocation/cell/NearbyCells.kt
45- com/vayunmathur/networklocation/wifi/NearbyWifi.kt
46
47## Verify (this module only)
48```
49./gradlew :networklocation:compileDevKotlin
50./gradlew :networklocation:lint
51./gradlew :networklocation:checkMetadata
52```