From 1cd5add16c6e1904434f8120647da01df743790b Mon Sep 17 00:00:00 2001 From: Christoph Studer Date: Thu, 3 Jul 2014 00:23:05 +0200 Subject: [PATCH] Fix 'stuck notification' bug Apply implied flags before notifying listeners. Bug: 15589158 Change-Id: Ie1c7374fa562ff62725361fb0dc8b0d1a6725618 --- .../notification/NotificationManagerService.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index bc148889d5b39..64887be1bd5a5 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1551,8 +1551,16 @@ public class NotificationManagerService extends SystemService { mNotificationsByKey.remove(old.sbn.getKey()); r.isUpdate = true; } + mNotificationsByKey.put(n.getKey(), r); + // Ensure if this is a foreground service that the proper additional + // flags are set. + if ((notification.flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) { + notification.flags |= Notification.FLAG_ONGOING_EVENT + | Notification.FLAG_NO_CLEAR; + } + applyZenModeLocked(r); Collections.sort(mNotificationList, mRankingComparator); @@ -1571,13 +1579,6 @@ public class NotificationManagerService extends SystemService { + n.getPackageName()); } - // Ensure if this is a foreground service that the proper additional - // flags are set. - if ((notification.flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) { - notification.flags |= Notification.FLAG_ONGOING_EVENT - | Notification.FLAG_NO_CLEAR; - } - buzzBeepBlinkLocked(r); } }