summaryrefslogtreecommitdiffstats
path: root/location
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-02-24 14:34:50 -0500
committerMike Lockwood <lockwood@android.com>2010-02-24 14:44:18 -0500
commitb7be5447a002b4a1cf7d4030cc8a0a330cd7517c (patch)
tree60fbdbeb8fc454b347411e435c1a1663b0957c67 /location
parent63598a0619776b421f27cd12fb29eb83dc327997 (diff)
downloadframeworks_base-b7be5447a002b4a1cf7d4030cc8a0a330cd7517c.zip
frameworks_base-b7be5447a002b4a1cf7d4030cc8a0a330cd7517c.tar.gz
frameworks_base-b7be5447a002b4a1cf7d4030cc8a0a330cd7517c.tar.bz2
GpsLocationProvider: Be less aggressive about getting fixes in bad conditions if we have a long fix interval.
Change-Id: I68bd884409ca15e584ab70e53cf142d60f318d9c BUG: 2215714 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'location')
-rwxr-xr-xlocation/java/com/android/internal/location/GpsLocationProvider.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java
index 36b6106..90b50cc 100755
--- a/location/java/com/android/internal/location/GpsLocationProvider.java
+++ b/location/java/com/android/internal/location/GpsLocationProvider.java
@@ -761,7 +761,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
positionMode = GPS_POSITION_MODE_STANDALONE;
}
- if (!native_start(positionMode, false, mFixInterval)) {
+ if (!native_start(positionMode, false, 1)) {
mStarted = false;
Log.e(TAG, "native_start failed in startNavigating()");
return;
@@ -872,7 +872,12 @@ public class GpsLocationProvider implements LocationProviderInterface {
}
if (mStarted && mStatus != LocationProvider.AVAILABLE) {
- mAlarmManager.cancel(mTimeoutIntent);
+ // we still want to time out if we do not receive MIN_FIX_COUNT
+ // within the time out and we are requesting infrequent fixes
+ if (mFixInterval < NO_FIX_TIMEOUT) {
+ mAlarmManager.cancel(mTimeoutIntent);
+ }
+
// send an intent to notify that the GPS is receiving fixes.
Intent intent = new Intent(GPS_FIX_CHANGE_ACTION);
intent.putExtra(EXTRA_ENABLED, true);