Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ffe0ad3 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Always use fresh NTP time for GPS



This is especially important when AGPS is disabled

Bug: 5355661

Change-Id: I072dbe1ddf43aa24c8fc39b750040504a1633c53
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 763480fb
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -554,13 +554,8 @@ public class GpsLocationProvider implements LocationProviderInterface {

        long delay;

        // force refresh NTP cache when outdated
        if (mNtpTime.getCacheAge() >= NTP_INTERVAL) {
            mNtpTime.forceRefresh();
        }

        // only update when NTP time is fresh
        if (mNtpTime.getCacheAge() < NTP_INTERVAL) {
        // GPS requires fresh NTP time
        if (mNtpTime.forceRefresh()) {
            long time = mNtpTime.getCachedNtpTime();
            long timeReference = mNtpTime.getCachedNtpTimeReference();
            long certainty = mNtpTime.getCacheCertainty();