Loading services/core/java/com/android/server/LocationManagerService.java +17 −13 Original line number Diff line number Diff line Loading @@ -1369,7 +1369,7 @@ public class LocationManagerService extends ILocationManager.Stub { } } else { if (!allowMonitoring || mAppOps.noteOpNoThrow(op, mCallerIdentity.mUid, || mAppOps.checkOpNoThrow(op, mCallerIdentity.mUid, mCallerIdentity.mPackageName) != AppOpsManager.MODE_ALLOWED) { mAppOps.finishOp(op, mCallerIdentity.mUid, mCallerIdentity.mPackageName); return false; Loading Loading @@ -1904,7 +1904,7 @@ public class LocationManagerService extends ILocationManager.Stub { int allowedResolutionLevel) { int op = resolutionLevelToOp(allowedResolutionLevel); if (op >= 0) { if (mAppOps.noteOp(op, uid, packageName) != AppOpsManager.MODE_ALLOWED) { if (mAppOps.checkOp(op, uid, packageName) != AppOpsManager.MODE_ALLOWED) { return false; } } Loading Loading @@ -2549,13 +2549,6 @@ public class LocationManagerService extends ILocationManager.Stub { return null; } if (!reportLocationAccessNoThrow(pid, uid, packageName, allowedResolutionLevel)) { if (D) { Log.d(TAG, "not returning last loc for no op app: " + packageName); } return null; } // Figure out the provider. Either its explicitly request (deprecated API's), // or use the fused provider Loading Loading @@ -2599,16 +2592,27 @@ public class LocationManagerService extends ILocationManager.Stub { return null; } Location lastLocation = null; if (allowedResolutionLevel < RESOLUTION_LEVEL_FINE) { Location noGPSLocation = location.getExtraLocation( Location.EXTRA_NO_GPS_LOCATION); if (noGPSLocation != null) { return new Location(mLocationFudger.getOrCreate(noGPSLocation)); lastLocation = new Location(mLocationFudger.getOrCreate(noGPSLocation)); } } else { return new Location(location); lastLocation = new Location(location); } return null; // Don't report location access if there is no last location to deliver. if (lastLocation != null) { if (!reportLocationAccessNoThrow( pid, uid, packageName, allowedResolutionLevel)) { if (D) { Log.d(TAG, "not returning last loc for no op app: " + packageName); } lastLocation = null; } } return lastLocation; } finally { Binder.restoreCallingIdentity(identity); } Loading Loading @@ -3233,7 +3237,7 @@ public class LocationManagerService extends ILocationManager.Stub { // Mock Providers private boolean canCallerAccessMockLocation(String opPackageName) { return mAppOps.noteOp(AppOpsManager.OP_MOCK_LOCATION, Binder.getCallingUid(), return mAppOps.checkOp(AppOpsManager.OP_MOCK_LOCATION, Binder.getCallingUid(), opPackageName) == AppOpsManager.MODE_ALLOWED; } Loading Loading
services/core/java/com/android/server/LocationManagerService.java +17 −13 Original line number Diff line number Diff line Loading @@ -1369,7 +1369,7 @@ public class LocationManagerService extends ILocationManager.Stub { } } else { if (!allowMonitoring || mAppOps.noteOpNoThrow(op, mCallerIdentity.mUid, || mAppOps.checkOpNoThrow(op, mCallerIdentity.mUid, mCallerIdentity.mPackageName) != AppOpsManager.MODE_ALLOWED) { mAppOps.finishOp(op, mCallerIdentity.mUid, mCallerIdentity.mPackageName); return false; Loading Loading @@ -1904,7 +1904,7 @@ public class LocationManagerService extends ILocationManager.Stub { int allowedResolutionLevel) { int op = resolutionLevelToOp(allowedResolutionLevel); if (op >= 0) { if (mAppOps.noteOp(op, uid, packageName) != AppOpsManager.MODE_ALLOWED) { if (mAppOps.checkOp(op, uid, packageName) != AppOpsManager.MODE_ALLOWED) { return false; } } Loading Loading @@ -2549,13 +2549,6 @@ public class LocationManagerService extends ILocationManager.Stub { return null; } if (!reportLocationAccessNoThrow(pid, uid, packageName, allowedResolutionLevel)) { if (D) { Log.d(TAG, "not returning last loc for no op app: " + packageName); } return null; } // Figure out the provider. Either its explicitly request (deprecated API's), // or use the fused provider Loading Loading @@ -2599,16 +2592,27 @@ public class LocationManagerService extends ILocationManager.Stub { return null; } Location lastLocation = null; if (allowedResolutionLevel < RESOLUTION_LEVEL_FINE) { Location noGPSLocation = location.getExtraLocation( Location.EXTRA_NO_GPS_LOCATION); if (noGPSLocation != null) { return new Location(mLocationFudger.getOrCreate(noGPSLocation)); lastLocation = new Location(mLocationFudger.getOrCreate(noGPSLocation)); } } else { return new Location(location); lastLocation = new Location(location); } return null; // Don't report location access if there is no last location to deliver. if (lastLocation != null) { if (!reportLocationAccessNoThrow( pid, uid, packageName, allowedResolutionLevel)) { if (D) { Log.d(TAG, "not returning last loc for no op app: " + packageName); } lastLocation = null; } } return lastLocation; } finally { Binder.restoreCallingIdentity(identity); } Loading Loading @@ -3233,7 +3237,7 @@ public class LocationManagerService extends ILocationManager.Stub { // Mock Providers private boolean canCallerAccessMockLocation(String opPackageName) { return mAppOps.noteOp(AppOpsManager.OP_MOCK_LOCATION, Binder.getCallingUid(), return mAppOps.checkOp(AppOpsManager.OP_MOCK_LOCATION, Binder.getCallingUid(), opPackageName) == AppOpsManager.MODE_ALLOWED; } Loading