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

Commit 61bb9a90 authored by Soonil Nagarkar's avatar Soonil Nagarkar Committed by Android (Google) Code Review
Browse files

Merge "Remove getTestProviderLocationRequests TestApi"

parents d74ae99b de402cf5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1719,7 +1719,6 @@ package android.location {
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
    method @NonNull public String[] getIgnoreSettingsWhitelist();
    method @Deprecated @Nullable @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public java.util.List<java.lang.String> getProviderPackages(@NonNull String);
    method @NonNull public java.util.List<android.location.LocationRequest> getTestProviderCurrentRequests(String);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.app.PendingIntent);
+2 −1
Original line number Diff line number Diff line
@@ -106,11 +106,12 @@ interface ILocationManager
    boolean isProviderEnabledForUser(String provider, int userId);
    boolean isLocationEnabledForUser(int userId);
    void setLocationEnabledForUser(boolean enabled, int userId);

    void addTestProvider(String name, in ProviderProperties properties, String packageName, String attributionTag);
    void removeTestProvider(String provider, String packageName, String attributionTag);
    void setTestProviderLocation(String provider, in Location location, String packageName, String attributionTag);
    void setTestProviderEnabled(String provider, boolean enabled, String packageName, String attributionTag);
    List<LocationRequest> getTestProviderCurrentRequests(String provider);

    LocationTime getGnssTimeMillis();

    void sendExtraCommand(String provider, String command, inout Bundle extras);
+0 −16
Original line number Diff line number Diff line
@@ -1814,22 +1814,6 @@ public class LocationManager {
    @Deprecated
    public void clearTestProviderStatus(@NonNull String provider) {}

    /**
     * Get the last list of {@link LocationRequest}s sent to the provider.
     *
     * @hide
     */
    @TestApi
    @NonNull
    public List<LocationRequest> getTestProviderCurrentRequests(String providerName) {
        Preconditions.checkArgument(providerName != null, "invalid null provider");
        try {
            return mService.getTestProviderCurrentRequests(providerName);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Sets a proximity alert for the location given by the position (latitude, longitude) and the
     * given radius.
+3 −15
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ public class LocationManagerService extends ILocationManager.Stub {
    private final LocalService mLocalService;

    private final GeofenceManager mGeofenceManager;
    @Nullable private volatile GnssManagerService mGnssManagerService = null;
    private volatile @Nullable GnssManagerService mGnssManagerService = null;
    private GeocoderProxy mGeocodeProvider;

    @GuardedBy("mLock")
@@ -604,7 +604,8 @@ public class LocationManagerService extends ILocationManager.Stub {
                || !request.getWorkSource().isEmpty();
        if (usesSystemApi
                && isChangeEnabled(PREVENT_PENDING_INTENT_SYSTEM_API_USAGE, identity.getUid())) {
            throw new SecurityException("PendingIntent location requests may not use system APIs");
            throw new SecurityException(
                    "PendingIntent location requests may not use system APIs: " + request);
        }

        request = validateLocationRequest(request, identity);
@@ -1090,19 +1091,6 @@ public class LocationManagerService extends ILocationManager.Stub {
        manager.setMockProviderAllowed(enabled);
    }

    @Override
    @NonNull
    public List<LocationRequest> getTestProviderCurrentRequests(String provider) {
        mContext.enforceCallingOrSelfPermission(permission.READ_DEVICE_CONFIG, null);

        LocationProviderManager manager = getLocationProviderManager(provider);
        if (manager == null) {
            throw new IllegalArgumentException("provider doesn't exist: " + provider);
        }

        return manager.getMockProviderRequests();
    }

    @Override
    public int handleShellCommand(ParcelFileDescriptor in, ParcelFileDescriptor out,
            ParcelFileDescriptor err, String[] args) {
+0 −10
Original line number Diff line number Diff line
@@ -1391,16 +1391,6 @@ class LocationProviderManager extends
        }
    }

    public List<LocationRequest> getMockProviderRequests() {
        synchronized (mLock) {
            if (!mProvider.isMock()) {
                throw new IllegalArgumentException(mName + " provider is not a test provider");
            }

            return mProvider.getCurrentRequest().getLocationRequests();
        }
    }

    @Nullable
    public Location getLastLocation(CallerIdentity identity, @PermissionLevel int permissionLevel,
            boolean ignoreLocationSettings) {
Loading