summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-10-25 09:30:42 -0400
committerMike Lockwood <lockwood@android.com>2011-10-25 09:47:05 -0400
commit2ffe0ad39127950074dc74bc5d15a284975da5ae (patch)
treee9a40148690b40f6efd21837eb217707d2c25bb2 /services
parent763480fbcabedfc2f425484ed74bc1e2e1392176 (diff)
downloadframeworks_base-2ffe0ad39127950074dc74bc5d15a284975da5ae.zip
frameworks_base-2ffe0ad39127950074dc74bc5d15a284975da5ae.tar.gz
frameworks_base-2ffe0ad39127950074dc74bc5d15a284975da5ae.tar.bz2
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>
Diffstat (limited to 'services')
-rwxr-xr-xservices/java/com/android/server/location/GpsLocationProvider.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/services/java/com/android/server/location/GpsLocationProvider.java b/services/java/com/android/server/location/GpsLocationProvider.java
index 0ce5499..00788ba 100755
--- a/services/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/java/com/android/server/location/GpsLocationProvider.java
@@ -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();