Only allow system code to call LocationManager.sendNiResponse()
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index cb6c168..7c33e37 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -1137,6 +1137,10 @@
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);
}