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

Commit 26b81d59 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Archive a copy of each dismissed notification.

We don't want to save all the heavyweight stuff, but we
can't lighten the notification in place because there may be
other active references.

Bug: 8839246
Change-Id: Id6dcc1cf5ae196ee3e42908d6b3ec4e928e9f0c5
parent c037282c
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -283,13 +283,14 @@ public class NotificationManagerService extends INotificationManager.Stub
        }

        public void record(StatusBarNotification nr) {
            // Nuke heavy parts of notification before storing in archive
            nr.getNotification().lightenPayload();

            if (mBuffer.size() == BUFFER_SIZE) {
                mBuffer.removeFirst();
            }
            mBuffer.addLast(nr);

            // We don't want to store the heavy bits of the notification in the archive,
            // but other clients in the system process might be using the object, so we
            // store a (lightened) copy.
            mBuffer.addLast(nr.cloneLight());
        }