From 3819f972df8c4c91b829425c2f83b19090a14167 Mon Sep 17 00:00:00 2001 From: Soonil Nagarkar Date: Wed, 19 Feb 2020 14:39:58 -0800 Subject: Revert requestSetProviderEnabled API Bug: 144955780 Test: presubmits Change-Id: Iec8520acfd98b9d9d92a4876ebfa899ac2a0731e --- .../java/android/location/LocationManagerInternal.java | 16 ---------------- .../com/android/internal/location/ILocationProvider.aidl | 2 -- location/lib/api/current.txt | 1 - .../android/location/provider/LocationProviderBase.java | 16 ---------------- 4 files changed, 35 deletions(-) (limited to 'location') diff --git a/location/java/android/location/LocationManagerInternal.java b/location/java/android/location/LocationManagerInternal.java index 085602cbcd4f..6006d5079b07 100644 --- a/location/java/android/location/LocationManagerInternal.java +++ b/location/java/android/location/LocationManagerInternal.java @@ -26,22 +26,6 @@ import android.annotation.NonNull; */ public abstract class LocationManagerInternal { - /** - * Requests that a provider change its allowed state. A provider may or may not honor this - * request, and if the provider does change its state as a result, that may happen - * asynchronously after some delay. - * - *

Setting a provider's state to allowed implies that any consents or terms and conditions - * that may be necessary to allow the provider are agreed to. Setting a providers state to - * disallowed implies that any consents or terms and conditions have their agreement revoked. - * - * @param provider A location provider as listed by {@link LocationManager#getAllProviders()} - * @param allowed Whether the location provider is being requested to allow or disallow - * itself - * @throws IllegalArgumentException if provider is null - */ - public abstract void requestSetProviderAllowed(@NonNull String provider, boolean allowed); - /** * Returns true if the given provider is enabled for the given user. * diff --git a/location/java/com/android/internal/location/ILocationProvider.aidl b/location/java/com/android/internal/location/ILocationProvider.aidl index b7817ff1e1fc..4246c6cd1004 100644 --- a/location/java/com/android/internal/location/ILocationProvider.aidl +++ b/location/java/com/android/internal/location/ILocationProvider.aidl @@ -37,6 +37,4 @@ interface ILocationProvider { @UnsupportedAppUsage oneway void sendExtraCommand(String command, in Bundle extras); - - oneway void requestSetAllowed(boolean allowed); } diff --git a/location/lib/api/current.txt b/location/lib/api/current.txt index 49fcaabe981a..9cc30d0d751e 100644 --- a/location/lib/api/current.txt +++ b/location/lib/api/current.txt @@ -17,7 +17,6 @@ package com.android.location.provider { method @Deprecated protected int onGetStatus(android.os.Bundle); method @Deprecated protected long onGetStatusUpdateTime(); method protected void onInit(); - method protected void onRequestSetAllowed(boolean); method protected boolean onSendExtraCommand(@Nullable String, @Nullable android.os.Bundle); method protected abstract void onSetRequest(com.android.location.provider.ProviderRequestUnbundled, android.os.WorkSource); method public void reportLocation(android.location.Location); diff --git a/location/lib/java/com/android/location/provider/LocationProviderBase.java b/location/lib/java/com/android/location/provider/LocationProviderBase.java index bd29d8ac2a85..d3fb58fe257e 100644 --- a/location/lib/java/com/android/location/provider/LocationProviderBase.java +++ b/location/lib/java/com/android/location/provider/LocationProviderBase.java @@ -315,17 +315,6 @@ public abstract class LocationProviderBase { return false; } - /** - * Invoked when the system wishes to request that the provider sets its allowed state as - * desired. This implies that the caller is providing/retracting consent for any terms and - * conditions or consents associated with the provider. - * - *

It is generally only necessary to override this function if the provider has some barriers - * or gates for enabling/disabling itself, in which case this function should handle those - * appropriately. A provider that is always allowed has no need to override this function. - */ - protected void onRequestSetAllowed(boolean allowed) {} - private final class Service extends ILocationProvider.Stub { @Override @@ -356,10 +345,5 @@ public abstract class LocationProviderBase { public void sendExtraCommand(String command, Bundle extras) { onSendExtraCommand(command, extras); } - - @Override - public void requestSetAllowed(boolean allowed) { - onRequestSetAllowed(allowed); - } } } -- cgit v1.2.3