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:
Soonil Nagarkar
2019-01-31 14:36:56 -08:00
parent affa55b49b
commit 0d77ea6893
12 changed files with 162 additions and 60 deletions

View File

@@ -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.
*