Permissions, Doze & stopping

Foreground location and background location are TWO grants

ACCESS_FINE_LOCATION is the runtime permission module 11 already requests β€” it covers location while the app is visible (in the foreground) or running a foreground service the user just started. On Android 10+, tracking a walk with the screen off and the app fully backgrounded β€” no active foreground-service notification the user just triggered β€” needs a second, separate grant: ACCESS_BACKGROUND_LOCATION. The system won't even show that dialog until fine/coarse location has already been granted, so it has to be requested after, never bundled into the same request.

Be straightforward with the user about why: a permission rationale that says "so your dog walk keeps tracking even with your phone locked" earns a grant far more often than a vague "needs your location" prompt. And be honest about Doze too β€” even a foreground service can see its network access deferred for a few minutes if the device has been stationary and screen-off long enough; PawWalk's offline-first design from module 14 is exactly what makes that survivable instead of catastrophic.