diff options
| author | 2017-08-18 18:18:57 +0000 | |
|---|---|---|
| committer | 2017-08-18 18:18:57 +0000 | |
| commit | 21bc812a25d4454d6bb7714eb5f5a8bfa3761c4c (patch) | |
| tree | 3a7d14540b37b95c9445026dcb616d831d54747a | |
| parent | 563e4982a95d0f7f15555cd7599a2c050d21ad08 (diff) | |
| parent | 5e702195cdd3cd1f20b79e2ea70b44a910ed8b94 (diff) | |
Merge "Exclude autogrouping from rate limiter" into oc-mr1-dev
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 845efa6186c8..f60d92340492 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -3105,7 +3105,7 @@ public class NotificationManagerService extends SystemService { } } if (summaryRecord != null && checkDisqualifyingFeatures(userId, MY_UID, - summaryRecord.sbn.getId(), summaryRecord.sbn.getTag(), summaryRecord)) { + summaryRecord.sbn.getId(), summaryRecord.sbn.getTag(), summaryRecord, true)) { mHandler.post(new EnqueueNotificationRunnable(userId, summaryRecord)); } } @@ -3450,7 +3450,8 @@ public class NotificationManagerService extends SystemService { user, null, System.currentTimeMillis()); final NotificationRecord r = new NotificationRecord(getContext(), n, channel); - if (!checkDisqualifyingFeatures(userId, notificationUid, id, tag, r)) { + if (!checkDisqualifyingFeatures(userId, notificationUid, id, tag, r, + r.sbn.getOverrideGroupKey() != null)) { return; } @@ -3505,7 +3506,7 @@ public class NotificationManagerService extends SystemService { * Has side effects. */ private boolean checkDisqualifyingFeatures(int userId, int callingUid, int id, String tag, - NotificationRecord r) { + NotificationRecord r, boolean isAutogroup) { final String pkg = r.sbn.getPackageName(); final String dialerPackage = getContext().getSystemService(TelecomManager.class).getSystemDialerPackage(); @@ -3529,7 +3530,8 @@ public class NotificationManagerService extends SystemService { // rate limit updates that aren't completed progress notifications if (mNotificationsByKey.get(r.sbn.getKey()) != null - && !r.getNotification().hasCompletedProgress()) { + && !r.getNotification().hasCompletedProgress() + && !isAutogroup) { final float appEnqueueRate = mUsageStats.getAppEnqueueRate(pkg); if (appEnqueueRate > mMaxPackageEnqueueRate) { @@ -3537,7 +3539,7 @@ public class NotificationManagerService extends SystemService { final long now = SystemClock.elapsedRealtime(); if ((now - mLastOverRateLogTime) > MIN_PACKAGE_OVERRATE_LOG_INTERVAL) { Slog.e(TAG, "Package enqueue rate is " + appEnqueueRate - + ". Shedding events. package=" + pkg); + + ". Shedding " + r.sbn.getKey() + ". package=" + pkg); mLastOverRateLogTime = now; } return false; |