Change provider packages API to test all providers
This will replace the LocationManager.getNetworkProviderPackage() API with LocationManager.isProviderPackage(). The network provider should not be considered special. In addition, providers now have the ability to specify additional packages that may make location requests on their behalf, so that those packages can be considered location providers as well. Bug: 117177078 Test: manually Change-Id: I204b56e7bb40874ac3347988474fb8afa787feb8
This commit is contained in:
@@ -2424,6 +2424,22 @@ public class LocationManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given package name matches a location provider package, and false
|
||||
* otherwise.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public boolean isProviderPackage(String packageName) {
|
||||
try {
|
||||
return mService.isProviderPackage(packageName);
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowFromSystemServer();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the extra location controller package for location services on the device.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user