diff options
author | Daniel Sandler <dsandler@android.com> | 2013-05-20 20:56:43 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2013-05-21 00:58:32 -0400 |
commit | 26b81d594ceb3026f64e8fa6980044fcb867d05c (patch) | |
tree | c96acc848a6f5019eb9cc186d098660fd9907df1 /services/java/com/android/server/NotificationManagerService.java | |
parent | c037282c1ca0d7589168c73f1cf8b19ecc3ffca4 (diff) |
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
Diffstat (limited to 'services/java/com/android/server/NotificationManagerService.java')
-rw-r--r-- | services/java/com/android/server/NotificationManagerService.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index f9b6eba68b60..111dbb237618 100644 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -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()); } |