summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2012-08-16 18:05:31 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-16 18:05:32 -0700
commit1f3f128ad1744dfbe4108857f322a805b1dc5eb7 (patch)
tree69ddf22ac5711d9e47664e66723253deed4a0fc1 /services
parent2ff0c048446c47f9cb995def2a6d8cc5177533a2 (diff)
parent4e31c4fffbc42b4c2b5dca6431cfeef9e078f5b4 (diff)
downloadframeworks_base-1f3f128ad1744dfbe4108857f322a805b1dc5eb7.zip
frameworks_base-1f3f128ad1744dfbe4108857f322a805b1dc5eb7.tar.gz
frameworks_base-1f3f128ad1744dfbe4108857f322a805b1dc5eb7.tar.bz2
Merge "Add javadoc for new location API's." into jb-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/LocationManagerService.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 054219b..bb005d9 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -904,14 +904,17 @@ public class LocationManagerService extends ILocationManager.Stub implements Obs
request.setQuality(LocationRequest.POWER_LOW);
break;
}
- // throttle fastest interval
+ // throttle
+ if (request.getInterval() < LocationFudger.FASTEST_INTERVAL_MS) {
+ request.setInterval(LocationFudger.FASTEST_INTERVAL_MS);
+ }
if (request.getFastestInterval() < LocationFudger.FASTEST_INTERVAL_MS) {
request.setFastestInterval(LocationFudger.FASTEST_INTERVAL_MS);
}
}
- // throttle interval if its faster than the fastest interval
- if (request.getInterval () < request.getFastestInterval()) {
- request.setInterval(request.getFastestInterval());
+ // make getFastestInterval() the minimum of interval and fastest interval
+ if (request.getFastestInterval() > request.getInterval()) {
+ request.setFastestInterval(request.getInterval());
}
return perm;
}
@@ -1287,6 +1290,8 @@ public class LocationManagerService extends ILocationManager.Stub implements Obs
}
private void handleLocationChangedLocked(Location location, boolean passive) {
+ if (D) Log.d(TAG, "incoming location: " + location);
+
long now = SystemClock.elapsedRealtime();
String provider = (passive ? LocationManager.PASSIVE_PROVIDER : location.getProvider());
ArrayList<UpdateRecord> records = mRecordsByProvider.get(provider);