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

Commit 51a0daa5 authored by Victoria Lease's avatar Victoria Lease Committed by Android Git Automerger
Browse files

am f9d5a079: am 18c2b6e7: Merge "throw SecurityException in isProviderEnabled()" into jb-mr1-dev

* commit 'f9d5a079':
  throw SecurityException in isProviderEnabled()
parents 4b1759d3 f9d5a079
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -1292,8 +1292,13 @@ public class LocationManagerService extends ILocationManager.Stub implements Run


    @Override
    @Override
    public boolean isProviderEnabled(String provider) {
    public boolean isProviderEnabled(String provider) {
        checkPermission();
        String perms = checkPermission();
        if (LocationManager.FUSED_PROVIDER.equals(provider)) return false;
        if (LocationManager.FUSED_PROVIDER.equals(provider)) return false;
        if (ACCESS_COARSE_LOCATION.equals(perms) &&
                !isProviderAllowedByCoarsePermission(provider)) {
            throw new SecurityException("The \"" + provider +
                    "\" provider requires ACCESS_FINE_LOCATION permission");
        }


        synchronized (mLock) {
        synchronized (mLock) {
            LocationProviderInterface p = mProvidersByName.get(provider);
            LocationProviderInterface p = mProvidersByName.get(provider);