Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89b6bf5a authored by Justin Koh's avatar Justin Koh
Browse files

DO NOT MERGE Readd removal of notification listener limit on posting

Listener packages are allowed to post > 50 notifications

This reverts commit 500a6b0c.
parent 8200b667
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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();