Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71225ecc authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

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
parent 8cc536c8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
+13 −0
Original line number Diff line number Diff line
@@ -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;
        }
    }
}