am ee57224c: Merge "Fix a bug where LocationManager\'s addGpsStatusListener does not throw a SecurityException if LocationManagerService.mGpsStatusProvider is null even when ACCESS_FINE_LOCATION permission is not present." into lmp-mr1-dev

* commit 'ee57224c0f96b4a4e26fe89f40509b32ea4b3602':
  Fix a bug where LocationManager's addGpsStatusListener does not throw a SecurityException if LocationManagerService.mGpsStatusProvider is null even when ACCESS_FINE_LOCATION permission is not present.
This commit is contained in:
Takayuki Hoshi
2014-10-24 04:14:20 +00:00
committed by Android Git Automerger

View File

@@ -1796,9 +1796,6 @@ public class LocationManagerService extends ILocationManager.Stub {
@Override
public boolean addGpsStatusListener(IGpsStatusListener listener, String packageName) {
if (mGpsStatusProvider == null) {
return false;
}
int allowedResolutionLevel = getCallerAllowedResolutionLevel();
checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,
LocationManager.GPS_PROVIDER);
@@ -1813,6 +1810,10 @@ public class LocationManagerService extends ILocationManager.Stub {
Binder.restoreCallingIdentity(ident);
}
if (mGpsStatusProvider == null) {
return false;
}
try {
mGpsStatusProvider.addGpsStatusListener(listener);
} catch (RemoteException e) {