diff options
author | Julia Reynolds <juliacr@google.com> | 2016-06-29 08:43:00 -0400 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-08-01 19:13:22 -0700 |
commit | 61e9103b5725965568e46657f4781dd8f2e5b623 (patch) | |
tree | 5005cace64ece84c08eab669901ef2c8e579375e | |
parent | 0813c5aaa9ee870a4bac375e462c296aa28ef6a6 (diff) | |
download | base-61e9103b5725965568e46657f4781dd8f2e5b623.tar.gz |
Check uid for notification policy access.
Bug: 29421441
Change-Id: Ia0a7b06112dde1c925ec3232f50bf4d90b17b5e5
(cherry picked from commit 0cd1b789567b60b963fc7b8935e898ea0e61a617)
-rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 5 |
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 11c65250f94c..ee09e163988e 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1983,6 +1983,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"); @@ -3643,6 +3644,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( |