summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Philip P. Moltmann <moltmann@google.com> 2018-08-31 09:30:18 -0700
committer Philip P. Moltmann <moltmann@google.com> 2018-08-31 11:30:57 -0700
commit71225ecc0c60d5015978e4d0f39ee5d0d165bd27 (patch)
tree827c95813710b49515186f0c69f1794ce91e14d7
parent8cc536c8d082d5f1100e0765e9544ba7ef191714 (diff)
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
-rw-r--r--api/system-current.txt1
-rw-r--r--location/java/android/location/LocationManager.java13
2 files changed, 14 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 1d5f586ab5e9..d11b21976edf 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -2618,6 +2618,7 @@ package android.location {
method public deprecated boolean addGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
method public void flushGnssBatch();
method public int getGnssBatchSize();
+ method public java.lang.String getNetworkProviderPackage();
method public boolean isLocationEnabledForUser(android.os.UserHandle);
method public boolean isProviderEnabledForUser(java.lang.String, android.os.UserHandle);
method public boolean registerGnssBatchedLocationCallback(long, boolean, android.location.BatchedLocationCallback, android.os.Handler);
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index b5d94315f97f..6d10c2d692b1 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -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;
+ }
+ }
}