summaryrefslogtreecommitdiff
path: root/.agent/code-map.md
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-06-05 00:31:12 +0000
committerClaude <noreply@anthropic.com>2026-06-05 00:31:12 +0000
commit3f7a1a181be300a04a8cfb00022aedc5d97676da (patch)
tree39c6b14dc598e7d56ae66796065bf281b9fbe68d /.agent/code-map.md
parent75c61c2b5b3fbda316dc4e82b6027d80ff7132d3 (diff)
parentbc8382014a8cd8cf781a95714b2b18f4920e2dce (diff)
Merge claude/location-retention-regression-AOycc: fix background location retention
- Stop GPS updates entirely when backgrounded and idle (was: drop to 5s ECONOMY) - Add PowerMode.NONE, ACTION_STOP_UPDATES; guard startLocationUpdatesInternal against NONE - Fix _currentPowerMode initial value FULL→NONE for accurate state tracking - Fix code-map GPS section (DeviceGpsProvider dead code, no No-GPS banner, replay=1 caveat) - Add review-intent-reality.md audit prompt + Living Documentation mandates to config.md https://claude.ai/code/session_0126zvB69ccVoFtx2o96oaE2
Diffstat (limited to '.agent/code-map.md')
-rw-r--r--.agent/code-map.md7
1 files changed, 5 insertions, 2 deletions
diff --git a/.agent/code-map.md b/.agent/code-map.md
index eb2f564..1a36542 100644
--- a/.agent/code-map.md
+++ b/.agent/code-map.md
@@ -359,8 +359,11 @@ CI (`android.yml`) triggers only on pushes to `main`. Firebase App Distribution
## 8. Context Tips & Gotchas
### Navigation / GPS
-- `DeviceGpsProvider` uses `FusedLocationProviderClient`. External GPS comes via NMEA TCP/UDP through `NmeaStreamManager` → `NmeaParser` → `GpsProvider` interface.
-- GPS fix is stale after 10 s — `MainViewModel` shows red "No GPS" banner.
+- `LocationService` (foreground service) uses `FusedLocationProviderClient` for Android GPS. External GPS comes via NMEA TCP/UDP through `NmeaStreamManager` → `NmeaParser`, emitted on `LocationService.nmeaGpsPositionFlow`.
+- `LocationService.recomputeBestPosition()` fuses NMEA + Android GPS: prefers NMEA if < 5 s old, falls back to Android. Result is `bestPosition: StateFlow<GpsPosition?>`.
+- `locationFlow: SharedFlow<GpsPosition>(replay=1)` carries raw Android fixes. **`replay=1` means new subscribers immediately receive the last cached position regardless of age — there is no staleness expiry.** Consumers must check `gpsData.timestampMs` if they care about age.
+- `DeviceGpsProvider` implements `GpsProvider` and has a `fixLostRunnable` (10 s timeout), but is **dead code** — it is never instantiated. `LocationService` does not use the `GpsProvider` interface. There is no "No GPS" banner.
+- Background location: `throttleLocationIfIdle()` (called on `onPause`) sends `ACTION_STOP_UPDATES` to stop `fusedLocationClient` when neither recording nor anchor-watch is active. `restoreLocationMode()` (called on `onResume`) restarts appropriate mode.
### NMEA
- `NmeaStreamManager` handles connection lifecycle (reconnect on failure). Don't manage socket lifecycle elsewhere.