From 41bec7bf371b73d622af403ac80a8e113ca042ce Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sat, 6 Jul 2013 16:48:44 -0700 Subject: Add permission that allows cancelling notifications from other apps. Change-Id: I055b17873e174f71174898a7649b1e221fd8c436 --- services/java/com/android/server/NotificationManagerService.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'services/java/com/android/server/NotificationManagerService.java') 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; -- cgit v1.1