summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Julia Reynolds <juliacr@google.com> 2016-06-29 08:43:00 -0400
committer Julia Reynolds <juliacr@google.com> 2016-06-29 08:44:03 -0400
commit0cd1b789567b60b963fc7b8935e898ea0e61a617 (patch)
treef2380a4694a83ade610c1b33ef71b610a5f0c0cc
parentbbadc5d313f99f3c02d282cbf12103c8c9364580 (diff)
Check uid for notification policy access.
Bug: 29421441 Change-Id: Ia0a7b06112dde1c925ec3232f50bf4d90b17b5e5
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 21bcacd3e9a7..1206263fb281 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1997,6 +1997,7 @@ public class NotificationManagerService extends SystemService {
android.Manifest.permission.MANAGE_NOTIFICATIONS)) {
return;
}
+ checkCallerIsSameApp(pkg);
if (!checkPolicyAccess(pkg)) {
Slog.w(TAG, "Notification policy access denied calling " + method);
throw new SecurityException("Notification policy access denied");
@@ -3655,6 +3656,10 @@ public class NotificationManagerService extends SystemService {
if (isCallerSystem()) {
return;
}
+ checkCallerIsSameApp(pkg);
+ }
+
+ private static void checkCallerIsSameApp(String pkg) {
final int uid = Binder.getCallingUid();
try {
ApplicationInfo ai = AppGlobals.getPackageManager().getApplicationInfo(