Lines Matching defs:location

17 package com.android.server.location;
28 import android.location.Geofence;
29 import android.location.Location;
30 import android.location.LocationListener;
31 import android.location.LocationManager;
32 import android.location.LocationRequest;
49 * Assume a maximum land speed, as a heuristic to throttle location updates.
51 * force a new location update anyway).
56 * Maximum age after which a location is no longer considered fresh enough to use.
205 * Returns the location received most recently from {@link #onLocationChanged(Location)},
207 * either if the location would be too stale to be useful.
213 Location location = mReceivingLocationUpdates ? mLastLocationUpdate : null;
214 if (location == null && !mFences.isEmpty()) {
215 location = mLocationManager.getLastLocation();
218 // Early out for null location.
219 if (location == null) {
223 // Early out for stale location.
225 if (now - location.getElapsedRealtimeNanos() > MAX_AGE_NANOS) {
229 // Made it this far? Return our fresh, valid location.
230 return location;
236 * {@link Intent}s for geofences that have been tripped. It also adjusts the active location
250 // Get a location to work with, either received via onLocationChanged() or
252 Location location = getFreshLocationLocked();
280 if (location != null) {
281 int event = state.processLocation(location);
290 // location fix that was used to calculate the distance in the first place.
298 // Request or cancel location updates if needed.
300 // Request location updates.
301 // Compute a location update interval based on the distance to the nearest fence.
303 if (location != null && Double.compare(minFenceDistance, Double.MAX_VALUE) != 0) {
312 mLastLocationUpdate = location;
319 // Cancel location updates.
330 Slog.d(TAG, "updateFences: location=" + location
381 public void onLocationChanged(Location location) {
384 mLastLocationUpdate = location;