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

Modern-Apps.git / networklocation / AGENTS.md

AGENTS.md2.9 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- Gradle: :networklocation / dir: networklocation/
7- Package roots present: provider
8- Entry files: MainActivity.kt (database-setup UI) + provider/LocationProviderImpl.kt (system provider entry)
9- Deps: :library:locationprovider, :library:downloadservice
10- Metadata: metadata_data/networklocation.md (present)
11- Rust: yes / screenshotTest: yes
12
13## Overview
14**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.
15**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`).
16**Entry points:** `provider/LocationProviderImpl.kt` → `provider/OfflineBeaconStore.kt` → `NetworkLocationService.kt` → `NetworkLocationNative.kt` (Rust solver).
17**Gotchas:**
18- `cache/`, `cell/`, `wifi/` are NOT closed package roots — don't add more files there
19- System-provider registration is signature/role-gated — sideloaded builds won't serve fixes
20- Beacon privacy is the product — never log or upload identifiers/positions
21
22## Key files
23### Root + provider/ — entries
24- com/vayunmathur/networklocation/MainActivity.kt — offline-DB setup UI
25- com/vayunmathur/networklocation/NetworkLocationService.kt
26- com/vayunmathur/networklocation/GeocodeService.kt
27- com/vayunmathur/networklocation/provider/LocationProviderImpl.kt — system entry
28- com/vayunmathur/networklocation/provider/OfflineBeaconStore.kt
29- com/vayunmathur/networklocation/provider/DatabaseStatusProvider.kt
30- com/vayunmathur/networklocation/provider/DatabaseStatusContract.kt
31- com/vayunmathur/networklocation/provider/LocationReportingTask.kt
32### Root — solver + stores (Rust bridges)
33- com/vayunmathur/networklocation/NetworkLocationNative.kt
34- com/vayunmathur/networklocation/GeocoderNative.kt
35- com/vayunmathur/networklocation/WpsStoreNative.kt
36- com/vayunmathur/networklocation/OfflineDatabases.kt
37- com/vayunmathur/networklocation/OfflineDatabaseSection.kt
38- com/vayunmathur/networklocation/PositioningData.kt
39- com/vayunmathur/networklocation/BeaconKeys.kt
40### cache/ + cell/ + wifi/ — beacon pipeline
41- com/vayunmathur/networklocation/cache/BeaconCache.kt
42- com/vayunmathur/networklocation/cache/TimedLruCache.kt
43- com/vayunmathur/networklocation/cell/NearbyCells.kt
44- com/vayunmathur/networklocation/wifi/NearbyWifi.kt
45
46## Verify (this module only)
47```
48./gradlew :networklocation:compileDevKotlin
49./gradlew :networklocation:lint
50./gradlew :networklocation:checkMetadata
51```