owntracks / android

OwnTracks Android App
http://owntracks.org
Eclipse Public License 1.0
1.27k stars 470 forks source link

Assign a default fastest interval. #1711

Closed wir3z closed 2 weeks ago

wir3z commented 2 weeks ago

Not sure if it's an artifact of the 2.5.x changes, or something Google changed on Android 14 (Pixel 7), but passing a null for fastest interval is just defaulting to interval.

When this is null, pegLocatorFastestIntervalToInterval is resulting in interval if it is true or false.

After this PR, it will report as fast as 1-second when false, to the interval when true.

growse commented 2 weeks ago

So i seem to remember that the GMS location lib docs basically said "if you don't supply a fastest interval, we'll let the device / sdk choose one dynamically". Empirically, this seemed to settle on a fastest interval rate of about double the requested interval.

Interestingly, I see that GMS have deprecated the setFastestInterval API (https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest#setFastestInterval(long)). I suspect that this is tied to your observation that on Android 14 it's defaulting to IMPLICIT_MIN_UPDATE_INTERVAL: https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.Builder#public-static-final-long-implicit_min_update_interval

Other than that, LGTM - could you ping a line in the CHANGELOG as well?

wir3z commented 2 weeks ago

That makes sense. Added a note to the bug fix section of the changelog.