Merge "Don't return passive location provider unless app has fine permissions."

This commit is contained in:
Mike Lockwood
2010-02-18 06:38:12 -08:00
committed by Android (Google) Code Review

View File

@@ -561,7 +561,8 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
}
private boolean isAllowedProviderSafe(String provider) {
if (LocationManager.GPS_PROVIDER.equals(provider)
if ((LocationManager.GPS_PROVIDER.equals(provider)
|| LocationManager.PASSIVE_PROVIDER.equals(provider))
&& (mContext.checkCallingOrSelfPermission(ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED)) {
return false;