summaryrefslogtreecommitdiffstats
path: root/location
diff options
context:
space:
mode:
authorGokula <gpkann@codeaurora.org>2010-08-02 19:50:49 -0700
committerSteve Kondik <shade@chemlab.org>2010-08-21 04:26:08 -0400
commita326b418133897179e19534d914d24d43dd4aa28 (patch)
tree9883c10414253fa7a65408529a17445d075aaaef /location
parentd922d1bd4110bb7ea97a5ae7b1a5a24348f54adb (diff)
downloadframeworks_base-a326b418133897179e19534d914d24d43dd4aa28.zip
frameworks_base-a326b418133897179e19534d914d24d43dd4aa28.tar.gz
frameworks_base-a326b418133897179e19534d914d24d43dd4aa28.tar.bz2
GPS: GpsLocationProvider is changed to accept NTP time always
The logic is changed within GpsLocationProvider to accept NTP time irrespective of the system time. This is because NTP time is guranteed to be accurate and system time may or not be accurate depending on whether the phone is camped on the network or not. This results in the GPS engine getting the best estimate of time always. CRs-Fixed : 242488 Change-Id: I4fe8847ad0619d3e3f2a7db5d2fb5f90c54320e6
Diffstat (limited to 'location')
-rwxr-xr-xlocation/java/com/android/internal/location/GpsLocationProvider.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java
index 8cdd07f..5c0a19a 100755
--- a/location/java/com/android/internal/location/GpsLocationProvider.java
+++ b/location/java/com/android/internal/location/GpsLocationProvider.java
@@ -74,7 +74,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
private static final String TAG = "GpsLocationProvider";
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = true;
private static final boolean VERBOSE = false;
/**
@@ -500,15 +500,16 @@ public class GpsLocationProvider implements LocationProviderInterface {
+ " certainty: " + certainty
+ " system time offset: " + systemTimeOffset);
- // sanity check NTP time and do not use if it is too far from system time
+ // sanity check NTP time
if (systemTimeOffset < 0) {
systemTimeOffset = -systemTimeOffset;
}
- if (systemTimeOffset < MAX_NTP_SYSTEM_TIME_OFFSET) {
native_inject_time(time, timeReference, certainty);
- } else {
+
+ if (systemTimeOffset > MAX_NTP_SYSTEM_TIME_OFFSET) {
Log.e(TAG, "NTP time differs from system time by " + systemTimeOffset
- + "ms. Ignoring.");
+ + ".Injecting NTP time anyway as it is guranteed to be accurate.");
+
}
delay = NTP_INTERVAL;
} else {