diff options
Diffstat (limited to 'services/core/java/com/android/server/notification/SnoozeHelper.java')
-rw-r--r-- | services/core/java/com/android/server/notification/SnoozeHelper.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/notification/SnoozeHelper.java b/services/core/java/com/android/server/notification/SnoozeHelper.java index 037cc6066518..ba1f1e91ec45 100644 --- a/services/core/java/com/android/server/notification/SnoozeHelper.java +++ b/services/core/java/com/android/server/notification/SnoozeHelper.java @@ -57,6 +57,8 @@ import java.util.Set; * NotificationManagerService helper for handling snoozed notifications. */ public class SnoozeHelper { + static final int CONCURRENT_SNOOZE_LIMIT = 500; + private static final String TAG = "SnoozeHelper"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private static final String INDENT = " "; @@ -91,6 +93,13 @@ public class SnoozeHelper { mUserProfiles = userProfiles; } + protected boolean canSnooze(int numberToSnooze) { + if ((mPackages.size() + numberToSnooze) > CONCURRENT_SNOOZE_LIMIT) { + return false; + } + return true; + } + protected boolean isSnoozed(int userId, String pkg, String key) { return mSnoozedNotifications.containsKey(userId) && mSnoozedNotifications.get(userId).containsKey(pkg) |