From fbac21410383e65951cb88ff567ae6bf2dcde82e Mon Sep 17 00:00:00 2001 From: Christoph Studer Date: Fri, 5 Sep 2014 17:40:43 +0200 Subject: [PATCH] NoMan: Fix speedbump with multiple package priorities Bug: 16782616 Change-Id: I747dc981f7974720da9f277ec6e3fba31c21f226 --- .../server/notification/NotificationManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index bc538ed144175..1dd0f80d4afb8 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2647,6 +2647,11 @@ public class NotificationManagerService extends SystemService { if (speedBumpIndex == -1 && // Intrusiveness trumps priority, hence ignore intrusives. !record.isRecentlyIntrusive() && + // Currently, package priority is either PRIORITY_DEFAULT or PRIORITY_MAX, so + // scanning for PRIORITY_MIN within the package bucket PRIORITY_DEFAULT + // (or lower as a safeguard) is sufficient to find the speedbump index. + // We'll have to revisit this when more package priority buckets are introduced. + record.getPackagePriority() <= Notification.PRIORITY_DEFAULT && record.sbn.getNotification().priority == Notification.PRIORITY_MIN) { speedBumpIndex = keys.size() - 1; }