summaryrefslogtreecommitdiffstats
path: root/services/core
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2016-06-28 15:16:21 -0400
committergitbuildkicker <android-build@google.com>2016-07-21 17:34:51 -0700
commit28460c294ebd9c9cab258c92a20e0e2cc63e64f0 (patch)
treedaf01378deff05026f977449230de27887036831 /services/core
parent81be4e3aac55305cbb5c9d523cf5c96c66604b39 (diff)
downloadframeworks_base-28460c294ebd9c9cab258c92a20e0e2cc63e64f0.zip
frameworks_base-28460c294ebd9c9cab258c92a20e0e2cc63e64f0.tar.gz
frameworks_base-28460c294ebd9c9cab258c92a20e0e2cc63e64f0.tar.bz2
Check caller's uid before allowing notification policy access.
Bug: 29421441 Change-Id: I7460268595e932d54660b02007bcd68b95fe8aec
Diffstat (limited to 'services/core')
-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 4351798..b922d26 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1642,6 +1642,7 @@ public class NotificationManagerService extends SystemService {
}
private void enforcePolicyAccess(String pkg, String method) {
+ checkCallerIsSameApp(pkg);
if (!checkPolicyAccess(pkg)) {
Slog.w(TAG, "Notification policy access denied calling " + method);
throw new SecurityException("Notification policy access denied");
@@ -3130,6 +3131,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(