Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7decd6d authored by Luigi Bruno's avatar Luigi Bruno Committed by Automerger Merge Worker
Browse files

Merge "Log attribution tag into Westworld LocationManagerApiUsageReport." into...

Merge "Log attribution tag into Westworld LocationManagerApiUsageReport." into sc-dev am: d77d2bf6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13730387

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0a029b8699184316d66a9516c9b6f321fec4c324
parents 8ac556b8 d77d2bf6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -370,6 +370,7 @@ public class GeofenceManager extends
                LocationStatsEnums.USAGE_ENDED,
                LocationStatsEnums.API_REQUEST_GEOFENCE,
                registration.getIdentity().getPackageName(),
                registration.getIdentity().getAttributionTag(),
                null,
                /* LocationRequest= */ null,
                /* hasListener= */ false,
@@ -383,6 +384,7 @@ public class GeofenceManager extends
                LocationStatsEnums.USAGE_ENDED,
                LocationStatsEnums.API_REQUEST_GEOFENCE,
                registration.getIdentity().getPackageName(),
                registration.getIdentity().getAttributionTag(),
                null,
                /* LocationRequest= */ null,
                /* hasListener= */ false,
+2 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@ public final class GnssMeasurementsProvider extends
                LocationStatsEnums.USAGE_STARTED,
                LocationStatsEnums.API_ADD_GNSS_MEASUREMENTS_LISTENER,
                registration.getIdentity().getPackageName(),
                registration.getIdentity().getAttributionTag(),
                null,
                null,
                true,
@@ -202,6 +203,7 @@ public final class GnssMeasurementsProvider extends
                LocationStatsEnums.USAGE_ENDED,
                LocationStatsEnums.API_ADD_GNSS_MEASUREMENTS_LISTENER,
                registration.getIdentity().getPackageName(),
                registration.getIdentity().getAttributionTag(),
                null,
                null,
                true,
+2 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ public class GnssStatusProvider extends
                LocationStatsEnums.USAGE_STARTED,
                LocationStatsEnums.API_REGISTER_GNSS_STATUS_CALLBACK,
                registration.getIdentity().getPackageName(),
                registration.getIdentity().getAttributionTag(),
                null,
                null,
                true,
@@ -96,6 +97,7 @@ public class GnssStatusProvider extends
                LocationStatsEnums.USAGE_ENDED,
                LocationStatsEnums.API_REGISTER_GNSS_STATUS_CALLBACK,
                registration.getIdentity().getPackageName(),
                registration.getIdentity().getAttributionTag(),
                null,
                null,
                true,
+7 −5
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@ public class LocationUsageLogger {
     * Log a location API usage event.
     */
    public void logLocationApiUsage(int usageType, int apiInUse,
            String packageName, String provider, LocationRequest locationRequest,
            boolean hasListener, boolean hasIntent,
            Geofence geofence, boolean foreground) {
            String packageName, String attributionTag, String provider,
            LocationRequest locationRequest, boolean hasListener,
            boolean hasIntent, Geofence geofence, boolean foreground) {
        try {
            if (hitApiUsageLogCap()) {
                return;
@@ -84,7 +84,8 @@ public class LocationUsageLogger {
                    isGeofenceNull
                        ? LocationStatsEnums.RADIUS_UNKNOWN
                        : bucketizeRadius(geofence.getRadius()),
                    categorizeActivityImportance(foreground));
                    categorizeActivityImportance(foreground),
                    attributionTag);
        } catch (Exception e) {
            // Swallow exceptions to avoid crashing LMS.
            Log.w(TAG, "Failed to log API usage to statsd.", e);
@@ -114,7 +115,8 @@ public class LocationUsageLogger {
                            /* isListenerNull= */ true,
                            /* isIntentNull= */ true),
                    /* bucketizedRadius= */ 0,
                    LocationStatsEnums.IMPORTANCE_UNKNOWN);
                    LocationStatsEnums.IMPORTANCE_UNKNOWN,
                    /* attribution_tag */ null);
        } catch (Exception e) {
            Log.w(TAG, "Failed to log API usage to statsd.", e);
        }
+2 −0
Original line number Diff line number Diff line
@@ -1854,6 +1854,7 @@ public class LocationProviderManager extends
                LocationStatsEnums.USAGE_STARTED,
                LocationStatsEnums.API_REQUEST_LOCATION_UPDATES,
                registration.getIdentity().getPackageName(),
                registration.getIdentity().getAttributionTag(),
                mName,
                registration.getRequest(),
                key instanceof PendingIntent,
@@ -1882,6 +1883,7 @@ public class LocationProviderManager extends
                LocationStatsEnums.USAGE_ENDED,
                LocationStatsEnums.API_REQUEST_LOCATION_UPDATES,
                registration.getIdentity().getPackageName(),
                registration.getIdentity().getAttributionTag(),
                mName,
                registration.getRequest(),
                key instanceof PendingIntent,