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

Commit b7f9d254 authored by Laurent Tu's avatar Laurent Tu
Browse files

Handle unknown case in LocationManager.getProvider

If a provider is unknown, return null in
LocationManagerService.getProviderProperties() instead of throwing a
security exception, so that LocationManager.getProvider() returns null
in this case, as specified by the javadoc.

Bug: 7359960
Change-Id: I1b8b74745f66717a3439a1d353a46a23272cc313
parent 4682cf02
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1340,6 +1340,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
     */
    @Override
    public ProviderProperties getProviderProperties(String provider) {
        if (mProvidersByName.get(provider) == null) {
          return null;
        }

        checkPermissionForProvider(getBestCallingPermission(), provider);

        LocationProviderInterface p;