Loading location/java/android/location/provider/LocationProviderBase.java +10 −6 Original line number Diff line number Diff line Loading @@ -62,6 +62,10 @@ import java.util.Objects; * <p>The service should have an intent filter in place for the location provider it wishes to * implements. Defaults for some providers are specified as constants in this class. * * <p>Location providers are identified by their UID / package name / attribution tag. Based on this * identity, location providers may be given some special privileges (such as making special * requests to other location providers). * * @hide */ @SystemApi Loading Loading @@ -95,14 +99,14 @@ public abstract class LocationProviderBase { public static final String ACTION_FUSED_PROVIDER = "com.android.location.service.FusedLocationProvider"; private final String mTag; private final @Nullable String mAttributionTag; private final IBinder mBinder; final String mTag; final @Nullable String mAttributionTag; final IBinder mBinder; // write locked on mBinder, read lock is optional depending on atomicity requirements private @Nullable volatile ILocationProviderManager mManager; private volatile ProviderProperties mProperties; private volatile boolean mAllowed; volatile @Nullable ILocationProviderManager mManager; volatile ProviderProperties mProperties; volatile boolean mAllowed; public LocationProviderBase(@NonNull Context context, @NonNull String tag, @NonNull ProviderProperties properties) { Loading services/core/java/com/android/server/location/eventlog/LocationEventLog.java +8 −9 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import android.annotation.Nullable; import android.location.LocationRequest; import android.location.provider.ProviderRequest; import android.location.util.identity.CallerIdentity; import android.os.Build; import android.os.PowerManager.LocationPowerSaveMode; import android.os.SystemClock; import android.util.ArrayMap; Loading @@ -47,8 +46,8 @@ public class LocationEventLog extends LocalEventLog { public static final LocationEventLog EVENT_LOG = new LocationEventLog(); private static int getLogSize() { if (Build.IS_DEBUGGABLE || D) { return 500; if (D) { return 600; } else { return 200; } Loading Loading @@ -152,7 +151,7 @@ public class LocationEventLog extends LocalEventLog { /** Logs a client for a location provider entering the foreground state. */ public void logProviderClientForeground(String provider, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_CLIENT_FOREGROUND, provider, identity); } getAggregateStats(provider, identity).markRequestForeground(); Loading @@ -160,7 +159,7 @@ public class LocationEventLog extends LocalEventLog { /** Logs a client for a location provider leaving the foreground state. */ public void logProviderClientBackground(String provider, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_CLIENT_BACKGROUND, provider, identity); } getAggregateStats(provider, identity).markRequestBackground(); Loading @@ -168,14 +167,14 @@ public class LocationEventLog extends LocalEventLog { /** Logs a client for a location provider entering the permitted state. */ public void logProviderClientPermitted(String provider, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_CLIENT_PERMITTED, provider, identity); } } /** Logs a client for a location provider leaving the permitted state. */ public void logProviderClientUnpermitted(String provider, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_CLIENT_UNPERMITTED, provider, identity); } } Loading @@ -187,7 +186,7 @@ public class LocationEventLog extends LocalEventLog { /** Logs a new incoming location for a location provider. */ public void logProviderReceivedLocations(String provider, int numLocations) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_RECEIVE_LOCATION, provider, numLocations); } } Loading @@ -195,7 +194,7 @@ public class LocationEventLog extends LocalEventLog { /** Logs a location deliver for a client of a location provider. */ public void logProviderDeliveredLocations(String provider, int numLocations, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_DELIVER_LOCATION, provider, numLocations, identity); } getAggregateStats(provider, identity).markLocationDelivered(); Loading Loading
location/java/android/location/provider/LocationProviderBase.java +10 −6 Original line number Diff line number Diff line Loading @@ -62,6 +62,10 @@ import java.util.Objects; * <p>The service should have an intent filter in place for the location provider it wishes to * implements. Defaults for some providers are specified as constants in this class. * * <p>Location providers are identified by their UID / package name / attribution tag. Based on this * identity, location providers may be given some special privileges (such as making special * requests to other location providers). * * @hide */ @SystemApi Loading Loading @@ -95,14 +99,14 @@ public abstract class LocationProviderBase { public static final String ACTION_FUSED_PROVIDER = "com.android.location.service.FusedLocationProvider"; private final String mTag; private final @Nullable String mAttributionTag; private final IBinder mBinder; final String mTag; final @Nullable String mAttributionTag; final IBinder mBinder; // write locked on mBinder, read lock is optional depending on atomicity requirements private @Nullable volatile ILocationProviderManager mManager; private volatile ProviderProperties mProperties; private volatile boolean mAllowed; volatile @Nullable ILocationProviderManager mManager; volatile ProviderProperties mProperties; volatile boolean mAllowed; public LocationProviderBase(@NonNull Context context, @NonNull String tag, @NonNull ProviderProperties properties) { Loading
services/core/java/com/android/server/location/eventlog/LocationEventLog.java +8 −9 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ import android.annotation.Nullable; import android.location.LocationRequest; import android.location.provider.ProviderRequest; import android.location.util.identity.CallerIdentity; import android.os.Build; import android.os.PowerManager.LocationPowerSaveMode; import android.os.SystemClock; import android.util.ArrayMap; Loading @@ -47,8 +46,8 @@ public class LocationEventLog extends LocalEventLog { public static final LocationEventLog EVENT_LOG = new LocationEventLog(); private static int getLogSize() { if (Build.IS_DEBUGGABLE || D) { return 500; if (D) { return 600; } else { return 200; } Loading Loading @@ -152,7 +151,7 @@ public class LocationEventLog extends LocalEventLog { /** Logs a client for a location provider entering the foreground state. */ public void logProviderClientForeground(String provider, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_CLIENT_FOREGROUND, provider, identity); } getAggregateStats(provider, identity).markRequestForeground(); Loading @@ -160,7 +159,7 @@ public class LocationEventLog extends LocalEventLog { /** Logs a client for a location provider leaving the foreground state. */ public void logProviderClientBackground(String provider, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_CLIENT_BACKGROUND, provider, identity); } getAggregateStats(provider, identity).markRequestBackground(); Loading @@ -168,14 +167,14 @@ public class LocationEventLog extends LocalEventLog { /** Logs a client for a location provider entering the permitted state. */ public void logProviderClientPermitted(String provider, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_CLIENT_PERMITTED, provider, identity); } } /** Logs a client for a location provider leaving the permitted state. */ public void logProviderClientUnpermitted(String provider, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_CLIENT_UNPERMITTED, provider, identity); } } Loading @@ -187,7 +186,7 @@ public class LocationEventLog extends LocalEventLog { /** Logs a new incoming location for a location provider. */ public void logProviderReceivedLocations(String provider, int numLocations) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_RECEIVE_LOCATION, provider, numLocations); } } Loading @@ -195,7 +194,7 @@ public class LocationEventLog extends LocalEventLog { /** Logs a location deliver for a client of a location provider. */ public void logProviderDeliveredLocations(String provider, int numLocations, CallerIdentity identity) { if (Build.IS_DEBUGGABLE || D) { if (D) { addLogEvent(EVENT_PROVIDER_DELIVER_LOCATION, provider, numLocations, identity); } getAggregateStats(provider, identity).markLocationDelivered(); Loading