Loading services/java/com/android/server/LocationManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1414,9 +1414,8 @@ public class LocationManagerService extends ILocationManager.Stub implements Run long now = SystemClock.elapsedRealtime(); String provider = (passive ? LocationManager.PASSIVE_PROVIDER : location.getProvider()); ArrayList<UpdateRecord> records = mRecordsByProvider.get(provider); if (records == null || records.size() == 0) return; // Skip if the provider is unknown. LocationProviderInterface p = mProvidersByName.get(provider); if (p == null) return; Loading @@ -1437,6 +1436,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run } lastLocation.set(location); // Skip if there are no UpdateRecords for this provider. ArrayList<UpdateRecord> records = mRecordsByProvider.get(provider); if (records == null || records.size() == 0) return; // Fetch coarse location Location coarseLocation = null; if (noGPSLocation != null && !noGPSLocation.equals(lastNoGPSLocation)) { Loading services/java/com/android/server/location/GeofenceManager.java +2 −4 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public class GeofenceManager implements LocationListener, PendingIntent.OnFinish private Object mLock = new Object(); // access to members below is synchronized on mLock private Location mLastLocation; private List<GeofenceState> mFences = new LinkedList<GeofenceState>(); public GeofenceManager(Context context, LocationBlacklist blacklist) { Loading @@ -77,7 +76,8 @@ public class GeofenceManager implements LocationListener, PendingIntent.OnFinish public void addFence(LocationRequest request, Geofence geofence, PendingIntent intent, int uid, String packageName) { GeofenceState state = new GeofenceState(geofence, mLastLocation, Location lastLocation = mLocationManager.getLastLocation(); GeofenceState state = new GeofenceState(geofence, lastLocation, request.getExpireAt(), packageName, intent); synchronized (mLock) { Loading Loading @@ -146,8 +146,6 @@ public class GeofenceManager implements LocationListener, PendingIntent.OnFinish List<PendingIntent> exitIntents = new LinkedList<PendingIntent>(); synchronized (mLock) { mLastLocation = location; removeExpiredFencesLocked(); for (GeofenceState state : mFences) { Loading Loading
services/java/com/android/server/LocationManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1414,9 +1414,8 @@ public class LocationManagerService extends ILocationManager.Stub implements Run long now = SystemClock.elapsedRealtime(); String provider = (passive ? LocationManager.PASSIVE_PROVIDER : location.getProvider()); ArrayList<UpdateRecord> records = mRecordsByProvider.get(provider); if (records == null || records.size() == 0) return; // Skip if the provider is unknown. LocationProviderInterface p = mProvidersByName.get(provider); if (p == null) return; Loading @@ -1437,6 +1436,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run } lastLocation.set(location); // Skip if there are no UpdateRecords for this provider. ArrayList<UpdateRecord> records = mRecordsByProvider.get(provider); if (records == null || records.size() == 0) return; // Fetch coarse location Location coarseLocation = null; if (noGPSLocation != null && !noGPSLocation.equals(lastNoGPSLocation)) { Loading
services/java/com/android/server/location/GeofenceManager.java +2 −4 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public class GeofenceManager implements LocationListener, PendingIntent.OnFinish private Object mLock = new Object(); // access to members below is synchronized on mLock private Location mLastLocation; private List<GeofenceState> mFences = new LinkedList<GeofenceState>(); public GeofenceManager(Context context, LocationBlacklist blacklist) { Loading @@ -77,7 +76,8 @@ public class GeofenceManager implements LocationListener, PendingIntent.OnFinish public void addFence(LocationRequest request, Geofence geofence, PendingIntent intent, int uid, String packageName) { GeofenceState state = new GeofenceState(geofence, mLastLocation, Location lastLocation = mLocationManager.getLastLocation(); GeofenceState state = new GeofenceState(geofence, lastLocation, request.getExpireAt(), packageName, intent); synchronized (mLock) { Loading Loading @@ -146,8 +146,6 @@ public class GeofenceManager implements LocationListener, PendingIntent.OnFinish List<PendingIntent> exitIntents = new LinkedList<PendingIntent>(); synchronized (mLock) { mLastLocation = location; removeExpiredFencesLocked(); for (GeofenceState state : mFences) { Loading