* commit 'f9d5a079c58a540c307cfe3a2dedb3e8bbd8513d': throw SecurityException in isProviderEnabled()
This commit is contained in:
@@ -1292,8 +1292,13 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
||||
|
||||
@Override
|
||||
public boolean isProviderEnabled(String provider) {
|
||||
checkPermission();
|
||||
String perms = checkPermission();
|
||||
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) {
|
||||
LocationProviderInterface p = mProvidersByName.get(provider);
|
||||
|
||||
Reference in New Issue
Block a user