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:
parent
5e02344699
commit
88f1cb953d
1 changed files with 6 additions and 1 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue