Loading services/core/java/com/android/server/LocationManagerService.java +6 −6 Original line number Diff line number Diff line Loading @@ -2361,7 +2361,7 @@ public class LocationManagerService extends ILocationManager.Stub { mRealRequest, mReceiver.isListener(), mReceiver.isPendingIntent(), /* radius= */ 0, /* geofence= */ null, mActivityManager.getPackageImportance(packageName)); // remove from mRecordsByProvider Loading Loading @@ -2541,7 +2541,7 @@ public class LocationManagerService extends ILocationManager.Stub { LocationStatsEnums.USAGE_STARTED, LocationStatsEnums.API_REQUEST_LOCATION_UPDATES, packageName, request, listener != null, intent != null, /* radius= */ 0, /* geofence= */ null, mActivityManager.getPackageImportance(packageName)); Receiver receiver; Loading Loading @@ -2844,7 +2844,7 @@ public class LocationManagerService extends ILocationManager.Stub { request, /* hasListener= */ false, intent != null, geofence.getRadius(), geofence, mActivityManager.getPackageImportance(packageName)); } Loading Loading @@ -2876,7 +2876,7 @@ public class LocationManagerService extends ILocationManager.Stub { /* LocationRequest= */ null, /* hasListener= */ false, intent != null, geofence.getRadius(), geofence, mActivityManager.getPackageImportance(packageName)); } mGeofenceManager.removeFence(geofence, intent); Loading Loading @@ -2973,7 +2973,7 @@ public class LocationManagerService extends ILocationManager.Stub { /* LocationRequest= */ null, /* hasListener= */ true, /* hasIntent= */ false, /* radius */ 0, /* geofence= */ null, mActivityManager.getPackageImportance(packageName)); } if (isThrottlingExemptLocked(callerIdentity) Loading Loading @@ -3014,7 +3014,7 @@ public class LocationManagerService extends ILocationManager.Stub { /* LocationRequest= */ null, /* hasListener= */ true, /* hasIntent= */ false, /* radius= */ 0, /* geofence= */ null, mActivityManager.getPackageImportance( linkedListener.mCallerIdentity.mPackageName)); } Loading services/core/java/com/android/server/LocationUsageLogger.java +8 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server; import android.app.ActivityManager; import android.location.Geofence; import android.location.LocationManager; import android.location.LocationRequest; import android.os.SystemClock; Loading Loading @@ -180,13 +181,14 @@ class LocationUsageLogger { public void logLocationApiUsage(int usageType, int apiInUse, String packageName, LocationRequest locationRequest, boolean hasListener, boolean hasIntent, float radius, int activityImportance) { Geofence geofence, int activityImportance) { try { if (!checkApiUsageLogCap()) { return; } boolean isLocationRequestNull = locationRequest == null; boolean isGeofenceNull = geofence == null; if (D) { Log.d(TAG, "log API Usage to statsd. usageType: " + usageType + ", apiInUse: " + apiInUse + ", packageName: " + (packageName == null ? "" : packageName) Loading @@ -194,7 +196,8 @@ class LocationUsageLogger { + (isLocationRequestNull ? "" : locationRequest.toString()) + ", hasListener: " + hasListener + ", hasIntent: " + hasIntent + ", radius: " + radius + ", geofence: " + (isGeofenceNull ? "" : geofence.toString()) + ", importance: " + activityImportance); } Loading @@ -219,7 +222,9 @@ class LocationUsageLogger { ? LocationStatsEnums.EXPIRATION_UNKNOWN : getBucketizedExpireIn(locationRequest.getExpireAt()), getCallbackType(apiInUse, hasListener, hasIntent), bucketizeRadiusToStatsdEnum(radius), isGeofenceNull ? LocationStatsEnums.RADIUS_UNKNOWN : bucketizeRadiusToStatsdEnum(geofence.getRadius()), categorizeActivityImportance(activityImportance)); } catch (Exception e) { // Swallow exceptions to avoid crashing LMS. Loading Loading
services/core/java/com/android/server/LocationManagerService.java +6 −6 Original line number Diff line number Diff line Loading @@ -2361,7 +2361,7 @@ public class LocationManagerService extends ILocationManager.Stub { mRealRequest, mReceiver.isListener(), mReceiver.isPendingIntent(), /* radius= */ 0, /* geofence= */ null, mActivityManager.getPackageImportance(packageName)); // remove from mRecordsByProvider Loading Loading @@ -2541,7 +2541,7 @@ public class LocationManagerService extends ILocationManager.Stub { LocationStatsEnums.USAGE_STARTED, LocationStatsEnums.API_REQUEST_LOCATION_UPDATES, packageName, request, listener != null, intent != null, /* radius= */ 0, /* geofence= */ null, mActivityManager.getPackageImportance(packageName)); Receiver receiver; Loading Loading @@ -2844,7 +2844,7 @@ public class LocationManagerService extends ILocationManager.Stub { request, /* hasListener= */ false, intent != null, geofence.getRadius(), geofence, mActivityManager.getPackageImportance(packageName)); } Loading Loading @@ -2876,7 +2876,7 @@ public class LocationManagerService extends ILocationManager.Stub { /* LocationRequest= */ null, /* hasListener= */ false, intent != null, geofence.getRadius(), geofence, mActivityManager.getPackageImportance(packageName)); } mGeofenceManager.removeFence(geofence, intent); Loading Loading @@ -2973,7 +2973,7 @@ public class LocationManagerService extends ILocationManager.Stub { /* LocationRequest= */ null, /* hasListener= */ true, /* hasIntent= */ false, /* radius */ 0, /* geofence= */ null, mActivityManager.getPackageImportance(packageName)); } if (isThrottlingExemptLocked(callerIdentity) Loading Loading @@ -3014,7 +3014,7 @@ public class LocationManagerService extends ILocationManager.Stub { /* LocationRequest= */ null, /* hasListener= */ true, /* hasIntent= */ false, /* radius= */ 0, /* geofence= */ null, mActivityManager.getPackageImportance( linkedListener.mCallerIdentity.mPackageName)); } Loading
services/core/java/com/android/server/LocationUsageLogger.java +8 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server; import android.app.ActivityManager; import android.location.Geofence; import android.location.LocationManager; import android.location.LocationRequest; import android.os.SystemClock; Loading Loading @@ -180,13 +181,14 @@ class LocationUsageLogger { public void logLocationApiUsage(int usageType, int apiInUse, String packageName, LocationRequest locationRequest, boolean hasListener, boolean hasIntent, float radius, int activityImportance) { Geofence geofence, int activityImportance) { try { if (!checkApiUsageLogCap()) { return; } boolean isLocationRequestNull = locationRequest == null; boolean isGeofenceNull = geofence == null; if (D) { Log.d(TAG, "log API Usage to statsd. usageType: " + usageType + ", apiInUse: " + apiInUse + ", packageName: " + (packageName == null ? "" : packageName) Loading @@ -194,7 +196,8 @@ class LocationUsageLogger { + (isLocationRequestNull ? "" : locationRequest.toString()) + ", hasListener: " + hasListener + ", hasIntent: " + hasIntent + ", radius: " + radius + ", geofence: " + (isGeofenceNull ? "" : geofence.toString()) + ", importance: " + activityImportance); } Loading @@ -219,7 +222,9 @@ class LocationUsageLogger { ? LocationStatsEnums.EXPIRATION_UNKNOWN : getBucketizedExpireIn(locationRequest.getExpireAt()), getCallbackType(apiInUse, hasListener, hasIntent), bucketizeRadiusToStatsdEnum(radius), isGeofenceNull ? LocationStatsEnums.RADIUS_UNKNOWN : bucketizeRadiusToStatsdEnum(geofence.getRadius()), categorizeActivityImportance(activityImportance)); } catch (Exception e) { // Swallow exceptions to avoid crashing LMS. Loading