diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index cb6c1682538bc..7c33e3736c4a6 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -1137,6 +1137,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run public boolean sendNiResponse(int notifId, int userResponse) { + if (Binder.getCallingUid() != Process.myUid()) { + throw new SecurityException( + "calling sendNiResponse from outside of the system is not allowed"); + } try { return mNetInitiatedListener.sendNiResponse(notifId, userResponse); }