diff options
| author | Nick Pelly <npelly@google.com> | 2012-05-04 13:29:20 -0700 |
|---|---|---|
| committer | Nick Pelly <npelly@google.com> | 2012-05-04 16:18:09 -0700 |
| commit | 6e4cb6a93b1a1b6970862d21769d14c9e583dd59 (patch) | |
| tree | 71c925b041899f48bfbadfc925fb7adb73cc9079 /services/java/com/android/server/LocationManagerService.java | |
| parent | e06747c727c9edc05c1d32f389a2347a11f653d5 (diff) | |
| download | frameworks_base-6e4cb6a93b1a1b6970862d21769d14c9e583dd59.zip frameworks_base-6e4cb6a93b1a1b6970862d21769d14c9e583dd59.tar.gz frameworks_base-6e4cb6a93b1a1b6970862d21769d14c9e583dd59.tar.bz2 | |
Log PID of apps requesting location updates.
BUG=6444765
Change-Id: Ib948b8fddb99f95f63486fbc096a26609c1a6c21
Diffstat (limited to 'services/java/com/android/server/LocationManagerService.java')
| -rw-r--r-- | services/java/com/android/server/LocationManagerService.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index d651111..4582d67 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -489,6 +489,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run mNetworkLocationProvider = new LocationProviderProxy(mContext, LocationManager.NETWORK_PROVIDER, mNetworkLocationProviderPackageName, mLocationHandler); + addProvider(mNetworkLocationProvider); } @@ -1156,11 +1157,11 @@ public class LocationManagerService extends ILocationManager.Stub implements Run if (p == null) { throw new IllegalArgumentException("provider=" + provider); } - receiver.requiredPermissions = checkPermissionsSafe(provider, receiver.requiredPermissions); // so wakelock calls will succeed + final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); boolean newUid = !providerHasListener(provider, callingUid, null); long identity = Binder.clearCallingIdentity(); @@ -1179,6 +1180,8 @@ public class LocationManagerService extends ILocationManager.Stub implements Run boolean isProviderEnabled = isAllowedBySettingsLocked(provider); if (isProviderEnabled) { long minTimeForProvider = getMinTimeLocked(provider); + Slog.i(TAG, "request " + provider + " (pid " + callingPid + ") " + minTime + + " " + minTimeForProvider + (singleShot ? " (singleshot)" : "")); p.setMinTime(minTimeForProvider, mTmpWorkSource); // try requesting single shot if singleShot is true, and fall back to // regular location tracking if requestSingleShotFix() is not supported @@ -1231,6 +1234,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run } // so wakelock calls will succeed + final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); long identity = Binder.clearCallingIdentity(); try { @@ -1280,8 +1284,13 @@ public class LocationManagerService extends ILocationManager.Stub implements Run LocationProviderInterface p = mProvidersByName.get(provider); if (p != null) { if (hasOtherListener) { - p.setMinTime(getMinTimeLocked(provider), mTmpWorkSource); + long minTime = getMinTimeLocked(provider); + Slog.i(TAG, "remove " + provider + " (pid " + callingPid + + "), next minTime = " + minTime); + p.setMinTime(minTime, mTmpWorkSource); } else { + Slog.i(TAG, "remove " + provider + " (pid " + callingPid + + "), disabled"); p.enableLocationTracking(false); } } |
