Skip to content

Fix screen-lock background tracking reliability - #1

Merged
sohamvjadhav merged 2 commits into
mainfrom
agent/screen-lock-reliability
Aug 12, 2026
Merged

Fix screen-lock background tracking reliability#1
sohamvjadhav merged 2 commits into
mainfrom
agent/screen-lock-reliability

Conversation

@sohamvjadhav

Copy link
Copy Markdown
Owner

What changed

  • Keep the service watchdog alive when location initialization fails.
  • Re-register GPS updates after screen lock/Doze when callbacks become stale.
  • Re-check location permission during watchdog recovery.
  • Persist the user-enabled service intent across sticky service restarts while respecting an explicit Stop.
  • Move the battery-optimization prompt until after service launch.
  • Surface failed service starts instead of silently appearing idle.
  • Reset speed-filter history when switching between GPS and motion sources.
  • Add focused unit tests for filtering and motion fallback.

Root cause

The watchdog returned permanently when the location manager was unavailable, and it did not recover requests that remained registered but stopped delivering callbacks after lock/Doze. The start path also opened Settings before launching the foreground service, which made some OEMs treat the launch as background-originated.

Validation

  • ./gradlew testDebugUnitTest passed
  • ./gradlew lintDebug passed with advisory warnings only
  • ./gradlew assembleDebug passed
  • git diff --check passed

Physical locked-screen and OEM battery-policy testing is still required before merging.

@sohamvjadhav
sohamvjadhav marked this pull request as ready for review August 12, 2026 15:39
@sohamvjadhav
sohamvjadhav merged commit 98a8133 into main Aug 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant