Refactor how location providers are managed
Put enabled/disabled state under location provider control, and use it to represent whether a location provider may be used, not whether the user has enabled or disabled a location provider. Bug: 118885128 Test: manually Change-Id: I1209c49c13ca8995b223f383ad332322fffc7a96
This commit is contained in:
@@ -1537,14 +1537,11 @@ 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 function has always been a no-op, and may be removed in the future.
|
||||
*/
|
||||
public void clearTestProviderLocation(String provider) {
|
||||
try {
|
||||
mService.clearTestProviderLocation(provider, mContext.getOpPackageName());
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
@Deprecated
|
||||
public void clearTestProviderLocation(String provider) {}
|
||||
|
||||
/**
|
||||
* Sets a mock enabled value for the given provider. This value will be used in place
|
||||
@@ -1575,13 +1572,12 @@ 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 Use {@link #setTestProviderEnabled(String, boolean)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void clearTestProviderEnabled(String provider) {
|
||||
try {
|
||||
mService.clearTestProviderEnabled(provider, mContext.getOpPackageName());
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
setTestProviderEnabled(provider, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user