Deprecate location provider status callbacks

Deprecate and remove logic around location provider status.

Bug: 118885128
Test: Tested manually on device
Change-Id: I68289cb5ed22e66532847758c36155a4ce607bbc
This commit is contained in:
Soonil Nagarkar
2018-11-08 11:46:43 -08:00
parent 9a72ec33d7
commit 94749f7ad1
17 changed files with 174 additions and 161 deletions

View File

@@ -146,9 +146,14 @@ public class LocationManager {
public static final String KEY_PROXIMITY_ENTERING = "entering";
/**
* This key is no longer in use.
*
* Key used for a Bundle extra holding an Integer status value
* when a status change is broadcast using a PendingIntent.
*
* @deprecated Status changes are deprecated and no longer broadcast.
*/
@Deprecated
public static final String KEY_STATUS_CHANGED = "status";
/**
@@ -1581,8 +1586,7 @@ public class LocationManager {
}
/**
* Sets mock status values for the given provider. These values will be used in place
* of any actual values from the provider.
* This method has no effect as provider status has been deprecated and is no longer supported.
*
* @param provider the provider name
* @param status the mock status
@@ -1593,7 +1597,10 @@ public class LocationManager {
* mock location app op} is not set to {@link android.app.AppOpsManager#MODE_ALLOWED
* allowed} for your app.
* @throws IllegalArgumentException if no provider with the given name exists
*
* @deprecated This method has no effect.
*/
@Deprecated
public void setTestProviderStatus(String provider, int status, Bundle extras, long updateTime) {
try {
mService.setTestProviderStatus(provider, status, extras, updateTime,
@@ -1604,21 +1611,19 @@ public class LocationManager {
}
/**
* Removes any mock status values associated with the given provider.
* This method has no effect as provider status has been deprecated and is no longer supported.
*
* @param provider the provider name
*
* @throws SecurityException if {@link android.app.AppOpsManager#OPSTR_MOCK_LOCATION
* mock location app op} is not set to {@link android.app.AppOpsManager#MODE_ALLOWED
* allowed} for your app.
* @throws IllegalArgumentException if no provider with the given name exists
*
* @deprecated This method has no effect.
*/
@Deprecated
public void clearTestProviderStatus(String provider) {
try {
mService.clearTestProviderStatus(provider, mContext.getOpPackageName());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
setTestProviderStatus(provider, LocationProvider.AVAILABLE, null, 0L);
}
// --- GPS-specific support ---