Skip to content

Commit 940453f

Browse files
mikeandroidAndroid (Google) Code Review
authored andcommitted
Merge "Always use fresh NTP time for GPS" into ics-mr0
2 parents 842f0f4 + 2ffe0ad commit 940453f

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)