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

Commit c6ab602b authored by Grace Cheng's avatar Grace Cheng Committed by Android (Google) Code Review
Browse files

Merge "Adds a function in LM for fetching ADAS allowlist"

parents 29a8ce7b 0a5ebb9c
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -146,4 +146,5 @@ interface ILocationManager
    // used by gts tests to verify whitelists
    String[] getBackgroundThrottlingWhitelist();
    PackageTagsList getIgnoreSettingsAllowlist();
    PackageTagsList getAdasAllowlist();
}
+13 −0
Original line number Diff line number Diff line
@@ -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.
     *
+5 −0
Original line number Diff line number Diff line
@@ -676,6 +676,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,