fix(todo): no fix sooner than the wait asked for (ADR 0033, D32)

A LocationRequest allows fixes six times as often as asked unless it
says otherwise, so on the fused provider they came every 15 s where
30 s was asked: too soon to count towards lying still, and the wait
never grew. On the emulator it now goes 30, 60, 120, 240 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-05 21:57:21 +01:00
commit 88f1cb953d
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -107,7 +107,12 @@ class LocationWatchService : Service(), LocationListener {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && manager.hasProvider(LocationManager.FUSED_PROVIDER)) {
manager.requestLocationUpdates(
LocationManager.FUSED_PROVIDER,
LocationRequest.Builder(interval).setQuality(LocationRequest.QUALITY_BALANCED_POWER_ACCURACY).build(),
LocationRequest.Builder(interval)
.setQuality(LocationRequest.QUALITY_BALANCED_POWER_ACCURACY)
// By default fixes may come six times as often as asked, and so
// sooner than a wait that counts towards lying still.
.setMinUpdateIntervalMillis(interval)
.build(),
mainExecutor,
this,
)