Skip to content

Commit 2ffe0ad

Browse files
committed
Always use fresh NTP time for GPS
This is especially important when AGPS is disabled Bug: 5355661 Change-Id: I072dbe1ddf43aa24c8fc39b750040504a1633c53 Signed-off-by: Mike Lockwood <lockwood@android.com>
1 parent 763480f commit 2ffe0ad

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

services/java/com/android/server/location/GpsLocationProvider.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,8 @@ private void handleInjectNtpTime() {
554554

555555
long delay;
556556

557-
// force refresh NTP cache when outdated
558-
if (mNtpTime.getCacheAge() >= NTP_INTERVAL) {
559-
mNtpTime.forceRefresh();
560-
}
561-
562-
// only update when NTP time is fresh
563-
if (mNtpTime.getCacheAge() < NTP_INTERVAL) {
557+
// GPS requires fresh NTP time
558+
if (mNtpTime.forceRefresh()) {
564559
long time = mNtpTime.getCachedNtpTime();
565560
long timeReference = mNtpTime.getCachedNtpTimeReference();
566561
long certainty = mNtpTime.getCacheCertainty();

0 commit comments

Comments
 (0)