From 589987ce209b88c8052329c7b5a042a3e0fda810 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Wed, 8 Dec 2021 10:22:00 -0500 Subject: [PATCH] Omit notification small icons from history parcel They aren't shown in the UI, so we can save some work Test: load notification history page Fixes: 206973316 Change-Id: Ia5089bd2f051e40f242f9f72528cbb8251ad9684 --- core/java/android/app/NotificationHistory.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/java/android/app/NotificationHistory.java b/core/java/android/app/NotificationHistory.java index eb9ec869af12a..b40fbee08049b 100644 --- a/core/java/android/app/NotificationHistory.java +++ b/core/java/android/app/NotificationHistory.java @@ -497,7 +497,11 @@ public final class NotificationHistory implements Parcelable { p.writeLong(notification.getPostedTimeMs()); p.writeString(notification.getTitle()); p.writeString(notification.getText()); - notification.getIcon().writeToParcel(p, flags); + p.writeBoolean(false); + // The current design does not display icons, so don't bother adding them to the parcel + //if (notification.getIcon() != null) { + // notification.getIcon().writeToParcel(p, flags); + //} } /** @@ -539,7 +543,9 @@ public final class NotificationHistory implements Parcelable { notificationOut.setPostedTimeMs(p.readLong()); notificationOut.setTitle(p.readString()); notificationOut.setText(p.readString()); - notificationOut.setIcon(Icon.CREATOR.createFromParcel(p)); + if (p.readBoolean()) { + notificationOut.setIcon(Icon.CREATOR.createFromParcel(p)); + } return notificationOut.build(); }