Repository navigation
GPS: Keep location resends compatible with Android 4.1 - #1208
Merged
o-jcardenass merged 1 commit intoOct 30, 2026
Merged
Conversation
emotionbug
force-pushed
the
pr/android16-gps-resend
branch
from
October 28, 2026 09:57
1147e42 to
59621b1
Compare
Keep the periodic headunit GPS resend available on API 16 without calling SystemClock.elapsedRealtimeNanos or Location.setElapsedRealtimeNanos, which were introduced in API 17. Refresh the outgoing location's wall-clock timestamp on every supported version and its monotonic timestamp only where the framework provides both APIs. Continue copying the last real fix rather than changing the stored fix or lastGpsFixAtMs. A resend must not renew the age of the original observation: the existing interval and stale-fix cutoff still determine when the phone should fall back to its own location. Missing monotonic timestamp support must not disable that bounded resend path. Retain the existing GPS fallback rationale and explain the timestamp ownership and version boundary next to the resend.
emotionbug
force-pushed
the
pr/android16-gps-resend
branch
from
October 28, 2026 16:12
fd4687d to
aca4a09
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GitHub build still supports API 16, but the periodic GPS resend calls both
SystemClock.elapsedRealtimeNanos()andLocation.setElapsedRealtimeNanos(), which were added in API 17. A recent GPS fix can therefore reach a missing-method failure on Android 4.1.Keep resending a copy with a fresh wall-clock timestamp on API 16, and refresh the monotonic timestamp only on API 17+. The original fix, resend interval and stale-fix cutoff are unchanged.