From 18ad9f657bda79069233c0b8e1476888ffd894d4 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 27 Aug 2009 14:01:23 -0700 Subject: [PATCH] Only allow system code to call LocationManager.sendNiResponse() Signed-off-by: Mike Lockwood --- services/java/com/android/server/LocationManagerService.java | 4 ++++ 1 file changed, 4 insertions(+) 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); }