Adds a function in LM for fetching ADAS allowlist
Bug: 244264468 Test: none Change-Id: I0bf0d4e0ef45aea8726d52bc661a6713c5e986ce
This commit is contained in:
@@ -26,6 +26,7 @@ import android.util.ArraySet;
|
||||
import com.android.internal.annotations.Immutable;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -140,6 +141,17 @@ public final class PackageTagsList implements Parcelable {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of packages.
|
||||
*
|
||||
* @deprecated Do not use.
|
||||
* @hide
|
||||
*/
|
||||
@Deprecated
|
||||
public @NonNull Collection<String> getPackages() {
|
||||
return new ArrayList<>(mPackageTags.keySet());
|
||||
}
|
||||
|
||||
public static final @NonNull Parcelable.Creator<PackageTagsList> CREATOR =
|
||||
new Parcelable.Creator<PackageTagsList>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -217,7 +229,7 @@ public final class PackageTagsList implements Parcelable {
|
||||
if (j > 0) {
|
||||
pw.print(", ");
|
||||
}
|
||||
if (attributionTag.startsWith(packageName)) {
|
||||
if (attributionTag != null && attributionTag.startsWith(packageName)) {
|
||||
pw.print(attributionTag.substring(packageName.length()));
|
||||
} else {
|
||||
pw.print(attributionTag);
|
||||
|
||||
@@ -141,4 +141,5 @@ interface ILocationManager
|
||||
// used by gts tests to verify whitelists
|
||||
String[] getBackgroundThrottlingWhitelist();
|
||||
PackageTagsList getIgnoreSettingsAllowlist();
|
||||
PackageTagsList getAdasAllowlist();
|
||||
}
|
||||
|
||||
@@ -503,6 +503,19 @@ public class LocationManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns ADAS packages and their associated attribution tags.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public @NonNull PackageTagsList getAdasAllowlist() {
|
||||
try {
|
||||
return mService.getAdasAllowlist();
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the extra location controller package on the device.
|
||||
*
|
||||
|
||||
@@ -675,6 +675,11 @@ public class LocationManagerService extends ILocationManager.Stub implements
|
||||
return mInjector.getSettingsHelper().getIgnoreSettingsAllowlist();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackageTagsList getAdasAllowlist() {
|
||||
return mInjector.getSettingsHelper().getAdasAllowlist();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICancellationSignal getCurrentLocation(String provider, LocationRequest request,
|
||||
|
||||
Reference in New Issue
Block a user