From d93d5adfe72d7f9785a595457ef7049737b0f526 Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Mon, 8 Sep 2014 16:34:03 -0400 Subject: [PATCH] Bring consistency to FLAG_ONLY_ALERT_ONCE semantics. For updates, the sounds layer checks for existence of the flag on the new version while the heads up was checking for the flag on the old version. Both now agree to check the new version. Bug: 14255617 Change-Id: Ib617df11f0dea17b5dfdf2ef6330bdbd18032ac6 --- .../com/android/systemui/statusbar/BaseStatusBar.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 1c4556f7c2aaa..304edae269c14 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1776,7 +1776,7 @@ public abstract class BaseStatusBar extends SystemUI implements oldEntry.notification.getNotification().tickerText); final boolean shouldInterrupt = shouldInterrupt(notification); - final boolean alertAgain = alertAgain(oldEntry); + final boolean alertAgain = alertAgain(oldEntry, n); boolean updateSuccessful = false; if (contentsUnchanged && bigContentsUnchanged && headsUpContentsUnchanged && publicUnchanged) { @@ -1940,10 +1940,9 @@ public abstract class BaseStatusBar extends SystemUI implements } } - private boolean alertAgain(Entry entry) { - final StatusBarNotification sbn = entry.notification; - return entry == null || !entry.hasInterrupted() - || (sbn.getNotification().flags & Notification.FLAG_ONLY_ALERT_ONCE) == 0; + private boolean alertAgain(Entry oldEntry, Notification newNotification) { + return oldEntry == null || !oldEntry.hasInterrupted() + || (newNotification.flags & Notification.FLAG_ONLY_ALERT_ONCE) == 0; } protected boolean shouldInterrupt(StatusBarNotification sbn) {