Loading services/core/java/com/android/server/LocationManagerService.java +12 −9 Original line number Diff line number Diff line Loading @@ -1727,7 +1727,7 @@ public class LocationManagerService extends ILocationManager.Stub { record.mReceiver.mIdentity.mUid, record.mReceiver.mIdentity.mPackageName, record.mReceiver.mAllowedResolutionLevel)) { LocationRequest locationRequest = record.mRequest; LocationRequest locationRequest = record.mRealRequest; long interval = locationRequest.getInterval(); if (!isThrottlingExemptLocked(record.mReceiver.mIdentity)) { Loading @@ -1740,6 +1740,7 @@ public class LocationManagerService extends ILocationManager.Stub { } } record.mRequest = locationRequest; providerRequest.locationRequests.add(locationRequest); if (interval < providerRequest.interval) { providerRequest.reportLocation = true; Loading Loading @@ -1832,7 +1833,8 @@ public class LocationManagerService extends ILocationManager.Stub { private class UpdateRecord { final String mProvider; final LocationRequest mRequest; final LocationRequest mRealRequest; // original request from client LocationRequest mRequest; // possibly throttled version of the request final Receiver mReceiver; boolean mIsForegroundUid; Location mLastFixBroadcast; Loading @@ -1843,6 +1845,7 @@ public class LocationManagerService extends ILocationManager.Stub { */ UpdateRecord(String provider, LocationRequest request, Receiver receiver) { mProvider = provider; mRealRequest = request; mRequest = request; mReceiver = receiver; mIsForegroundUid = isImportanceForeground( Loading Loading @@ -1892,7 +1895,7 @@ public class LocationManagerService extends ILocationManager.Stub { public String toString() { return "UpdateRecord[" + mProvider + " " + mReceiver.mIdentity.mPackageName + "(" + mReceiver.mIdentity.mUid + (mIsForegroundUid ? " foreground" : " background") + ")" + " " + mRequest + "]"; + ")" + " " + mRealRequest + "]"; } } Loading Loading @@ -2533,7 +2536,7 @@ public class LocationManagerService extends ILocationManager.Stub { } // Check whether sufficient time has passed long minTime = record.mRequest.getFastestInterval(); long minTime = record.mRealRequest.getFastestInterval(); long delta = (loc.getElapsedRealtimeNanos() - lastLoc.getElapsedRealtimeNanos()) / NANOS_PER_MILLI; if (delta < minTime - MAX_PROVIDER_SCHEDULING_JITTER_MS) { Loading @@ -2541,7 +2544,7 @@ public class LocationManagerService extends ILocationManager.Stub { } // Check whether sufficient distance has been traveled double minDistance = record.mRequest.getSmallestDisplacement(); double minDistance = record.mRealRequest.getSmallestDisplacement(); if (minDistance > 0.0) { if (loc.distanceTo(lastLoc) <= minDistance) { return false; Loading @@ -2549,12 +2552,12 @@ public class LocationManagerService extends ILocationManager.Stub { } // Check whether sufficient number of udpates is left if (record.mRequest.getNumUpdates() <= 0) { if (record.mRealRequest.getNumUpdates() <= 0) { return false; } // Check whether the expiry date has passed return record.mRequest.getExpireAt() >= now; return record.mRealRequest.getExpireAt() >= now; } private void handleLocationChangedLocked(Location location, boolean passive) { Loading Loading @@ -2672,7 +2675,7 @@ public class LocationManagerService extends ILocationManager.Stub { Slog.w(TAG, "RemoteException calling onLocationChanged on " + receiver); receiverDead = true; } r.mRequest.decrementNumUpdates(); r.mRealRequest.decrementNumUpdates(); } } Loading @@ -2688,7 +2691,7 @@ public class LocationManagerService extends ILocationManager.Stub { } // track expired records if (r.mRequest.getNumUpdates() <= 0 || r.mRequest.getExpireAt() < now) { if (r.mRealRequest.getNumUpdates() <= 0 || r.mRealRequest.getExpireAt() < now) { if (deadUpdateRecords == null) { deadUpdateRecords = new ArrayList<>(); } Loading Loading
services/core/java/com/android/server/LocationManagerService.java +12 −9 Original line number Diff line number Diff line Loading @@ -1727,7 +1727,7 @@ public class LocationManagerService extends ILocationManager.Stub { record.mReceiver.mIdentity.mUid, record.mReceiver.mIdentity.mPackageName, record.mReceiver.mAllowedResolutionLevel)) { LocationRequest locationRequest = record.mRequest; LocationRequest locationRequest = record.mRealRequest; long interval = locationRequest.getInterval(); if (!isThrottlingExemptLocked(record.mReceiver.mIdentity)) { Loading @@ -1740,6 +1740,7 @@ public class LocationManagerService extends ILocationManager.Stub { } } record.mRequest = locationRequest; providerRequest.locationRequests.add(locationRequest); if (interval < providerRequest.interval) { providerRequest.reportLocation = true; Loading Loading @@ -1832,7 +1833,8 @@ public class LocationManagerService extends ILocationManager.Stub { private class UpdateRecord { final String mProvider; final LocationRequest mRequest; final LocationRequest mRealRequest; // original request from client LocationRequest mRequest; // possibly throttled version of the request final Receiver mReceiver; boolean mIsForegroundUid; Location mLastFixBroadcast; Loading @@ -1843,6 +1845,7 @@ public class LocationManagerService extends ILocationManager.Stub { */ UpdateRecord(String provider, LocationRequest request, Receiver receiver) { mProvider = provider; mRealRequest = request; mRequest = request; mReceiver = receiver; mIsForegroundUid = isImportanceForeground( Loading Loading @@ -1892,7 +1895,7 @@ public class LocationManagerService extends ILocationManager.Stub { public String toString() { return "UpdateRecord[" + mProvider + " " + mReceiver.mIdentity.mPackageName + "(" + mReceiver.mIdentity.mUid + (mIsForegroundUid ? " foreground" : " background") + ")" + " " + mRequest + "]"; + ")" + " " + mRealRequest + "]"; } } Loading Loading @@ -2533,7 +2536,7 @@ public class LocationManagerService extends ILocationManager.Stub { } // Check whether sufficient time has passed long minTime = record.mRequest.getFastestInterval(); long minTime = record.mRealRequest.getFastestInterval(); long delta = (loc.getElapsedRealtimeNanos() - lastLoc.getElapsedRealtimeNanos()) / NANOS_PER_MILLI; if (delta < minTime - MAX_PROVIDER_SCHEDULING_JITTER_MS) { Loading @@ -2541,7 +2544,7 @@ public class LocationManagerService extends ILocationManager.Stub { } // Check whether sufficient distance has been traveled double minDistance = record.mRequest.getSmallestDisplacement(); double minDistance = record.mRealRequest.getSmallestDisplacement(); if (minDistance > 0.0) { if (loc.distanceTo(lastLoc) <= minDistance) { return false; Loading @@ -2549,12 +2552,12 @@ public class LocationManagerService extends ILocationManager.Stub { } // Check whether sufficient number of udpates is left if (record.mRequest.getNumUpdates() <= 0) { if (record.mRealRequest.getNumUpdates() <= 0) { return false; } // Check whether the expiry date has passed return record.mRequest.getExpireAt() >= now; return record.mRealRequest.getExpireAt() >= now; } private void handleLocationChangedLocked(Location location, boolean passive) { Loading Loading @@ -2672,7 +2675,7 @@ public class LocationManagerService extends ILocationManager.Stub { Slog.w(TAG, "RemoteException calling onLocationChanged on " + receiver); receiverDead = true; } r.mRequest.decrementNumUpdates(); r.mRealRequest.decrementNumUpdates(); } } Loading @@ -2688,7 +2691,7 @@ public class LocationManagerService extends ILocationManager.Stub { } // track expired records if (r.mRequest.getNumUpdates() <= 0 || r.mRequest.getExpireAt() < now) { if (r.mRealRequest.getNumUpdates() <= 0 || r.mRealRequest.getExpireAt() < now) { if (deadUpdateRecords == null) { deadUpdateRecords = new ArrayList<>(); } Loading