Expose LocationManager#getNetworkProviderPackage as @SystemApi

The PermissonController is going to become a mainline module, hence it
has to compile against @SystemApi.

The permission controller needs to know which package is the network
provider as it treats the location permission of the location provider
page special.

As far as I understood the current API is not protected. I would like to
leave adding the protection to the location team.

Bug: 110953302
Test: Built
Change-Id: Ic0691bd2254137273160ee6c2e6bb10257205d54
This commit is contained in:
Philip P. Moltmann
2018-08-31 09:30:18 -07:00
parent 8cc536c8d0
commit 71225ecc0c
2 changed files with 14 additions and 0 deletions

View File

@@ -2378,4 +2378,17 @@ public class LocationManager {
throw new IllegalArgumentException("invalid geofence: " + fence);
}
}
/**
* @hide
*/
@SystemApi
public String getNetworkProviderPackage() {
try {
return mService.getNetworkProviderPackage();
} catch (RemoteException e) {
e.rethrowFromSystemServer();
return null;
}
}
}