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

Commit 1cd5add1 authored by Christoph Studer's avatar Christoph Studer
Browse files

Fix 'stuck notification' bug

Apply implied flags before notifying listeners.

Bug: 15589158
Change-Id: Ie1c7374fa562ff62725361fb0dc8b0d1a6725618
parent 4aa03ef6
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -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);
                }
            }