diff options
| author | Claude <noreply@anthropic.com> | 2026-06-04 23:34:44 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-06-04 23:34:44 +0000 |
| commit | 23e72f39ced0e051d9803415efde3729a9fd433a (patch) | |
| tree | b09c2269ff20df7eb75676491599e91c9f5f8e54 /.github | |
| parent | 75c61c2b5b3fbda316dc4e82b6027d80ff7132d3 (diff) | |
Fix location-retention regression: stop GPS when backgrounded and idle
The previous fix (48ae3b0) dropped to ECONOMY (5 s interval) on app
pause, but never stopped location requests. The fusedLocationClient
continued polling indefinitely in the background even with nothing
recording or anchor-watching — accessing location without any need.
Fix:
- Add PowerMode.NONE to represent "no updates in flight"
- Add ACTION_STOP_UPDATES to LocationService: calls
stopLocationUpdatesInternal() and parks _currentPowerMode at NONE
- Guard startLocationUpdatesInternal() against PowerMode.NONE so a
stray setPowerMode(NONE) call can never request zero-interval updates
- Change _currentPowerMode initial value from FULL to NONE (accurate:
no updates are running at process start)
- throttleLocationIfIdle() now sends ACTION_STOP_UPDATES instead of
ACTION_START_ECONOMY; the existing restoreLocationMode() on onResume
already sends ACTION_START_ECONOMY which transitions NONE→ECONOMY
correctly since NONE != ECONOMY bypasses the no-op guard
Tracking and anchor-watch paths are unchanged: throttleLocationIfIdle()
skips the stop if either is active, and onResume sends ACTION_START_FULL
when recording is still in progress.
https://claude.ai/code/session_0126zvB69ccVoFtx2o96oaE2
Diffstat (limited to '.github')
0 files changed, 0 insertions, 0 deletions
