diff options
author | Koushik Dutta <koushd@gmail.com> | 2013-07-06 16:48:44 -0700 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2013-07-06 16:51:09 -0700 |
commit | 41bec7bf371b73d622af403ac80a8e113ca042ce (patch) | |
tree | 1490e91cc9b326cf884fd04c41c99835979381d5 /services | |
parent | 2ce68c452863feda4cf3465263122c74f5801377 (diff) | |
download | frameworks_base-41bec7bf371b73d622af403ac80a8e113ca042ce.zip frameworks_base-41bec7bf371b73d622af403ac80a8e113ca042ce.tar.gz frameworks_base-41bec7bf371b73d622af403ac80a8e113ca042ce.tar.bz2 |
Add permission that allows cancelling notifications from other apps.
Change-Id: I055b17873e174f71174898a7649b1e221fd8c436
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/NotificationManagerService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 41377d2..4928a86 100644 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -1583,6 +1583,10 @@ public class NotificationManagerService extends INotificationManager.Stub } void checkCallerIsSystemOrSameApp(String pkg) { + if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.CANCEL_NOTIFICATIONS) + == PackageManager.PERMISSION_GRANTED) { + return; + } int uid = Binder.getCallingUid(); if (UserHandle.getAppId(uid) == Process.SYSTEM_UID || uid == 0) { return; |