From 626447294a48ffe31d864b98ec8f343febf47603 Mon Sep 17 00:00:00 2001 From: Ned Burns Date: Fri, 18 Oct 2019 13:13:00 -0400 Subject: [PATCH] Remove last ranking-derived member from NotifEntry This can be extracted directly from the Ranking, no need to store a second copy. Test: atest Change-Id: I254079fd010ca4e984c28a96e471f5dd9075c81c --- .../android/systemui/bubbles/BubbleData.java | 2 +- .../collection/NotificationEntry.java | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java index 2f7f47b6cda7d..4e229c00b8912 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java @@ -184,7 +184,7 @@ public class BubbleData { Log.d(TAG, "notificationEntryUpdated: " + entry); } Bubble bubble = getBubbleWithKey(entry.getKey()); - suppressFlyout = !entry.isVisuallyInterruptive || suppressFlyout; + suppressFlyout = !entry.getRanking().visuallyInterruptive() || suppressFlyout; if (bubble == null) { // Create a new bubble diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java index e004ca7d1f1d9..048e784cd3d5e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java @@ -155,12 +155,6 @@ public final class NotificationEntry { */ private boolean hasSentReply; - /** - * Whether this notification has changed in visual appearance since the previous post. - * New notifications are interruptive by default. - */ - public boolean isVisuallyInterruptive; - /** * Whether this notification is shown to the user as a high priority notification: visible on * the lock screen/status bar and in the top section in the shade. @@ -236,10 +230,15 @@ public final class NotificationEntry { throw new IllegalArgumentException("New key " + ranking.getKey() + " doesn't match existing key " + mKey); } + mRanking = ranking; - isVisuallyInterruptive = ranking.visuallyInterruptive(); } + + /* + * Convenience getters for SBN and Ranking members + */ + public NotificationChannel getChannel() { return mRanking.getChannel(); } @@ -287,6 +286,12 @@ public final class NotificationEntry { } + /* + * Old methods + * + * TODO: Remove as many of these as possible + */ + public void setInterruption() { interruption = true; }