summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJustin Koh <justinkoh@google.com>2014-06-05 13:50:58 -0700
committerJustin Koh <justinkoh@google.com>2014-06-05 13:50:58 -0700
commit89b6bf5a118322d923cb9349515f06e32003c6ef (patch)
tree3a859edc8bc748a4bff36799b00e675d752719a6 /services
parent8200b667ea75b7d5353343f9e2f22e33b373077e (diff)
downloadframeworks_base-89b6bf5a118322d923cb9349515f06e32003c6ef.zip
frameworks_base-89b6bf5a118322d923cb9349515f06e32003c6ef.tar.gz
frameworks_base-89b6bf5a118322d923cb9349515f06e32003c6ef.tar.bz2
DO NOT MERGE Readd removal of notification listener limit on posting
Listener packages are allowed to post > 50 notifications This reverts commit 500a6b0ca68aaad6140b5af2dae94349be9f7aeb.
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index b708c16..d163a617 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1729,14 +1729,15 @@ public class NotificationManagerService extends SystemService {
}
checkCallerIsSystemOrSameApp(pkg);
final boolean isSystemNotification = isUidSystem(callingUid) || ("android".equals(pkg));
+ final boolean isNotificationFromListener = mEnabledListenerPackageNames.contains(pkg);
final int userId = ActivityManager.handleIncomingUser(callingPid,
callingUid, incomingUserId, true, false, "enqueueNotification", pkg);
final UserHandle user = new UserHandle(userId);
// Limit the number of notifications that any given package except the android
- // package can enqueue. Prevents DOS attacks and deals with leaks.
- if (!isSystemNotification) {
+ // package or a registered listener can enqueue. Prevents DOS attacks and deals with leaks.
+ if (!isSystemNotification && !isNotificationFromListener) {
synchronized (mNotificationList) {
int count = 0;
final int N = mNotificationList.size();