diff options
| author | 2020-07-08 13:35:57 +0000 | |
|---|---|---|
| committer | 2020-07-08 13:35:57 +0000 | |
| commit | e35f399130bf0c974b3cf39b9dfdbe4a15f9cd21 (patch) | |
| tree | 34de4820b3ad4fee5aaedb2cdb88c5906470ed1b | |
| parent | 781f492b1ec74e82562f85790b234dbdf72308b9 (diff) | |
| parent | a568597191a18348eaa02646137825fbbe06e981 (diff) | |
Merge "Prevent bell icon from disappearing on immediate followup notification." into rvc-qpr-dev am: a568597191
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12099423
Change-Id: Ic5e0ee6eef7209f4426055601eb851fd305a282f
3 files changed, 15 insertions, 4 deletions
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index c52b02bb6a3c..dfd305330b14 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -1903,6 +1903,17 @@ public abstract class NotificationListenerService extends Service { /** * @hide */ + public @NonNull Ranking withAudiblyAlertedInfo(@Nullable Ranking previous) { + if (previous != null && previous.mLastAudiblyAlertedMs > 0 + && this.mLastAudiblyAlertedMs <= 0) { + this.mLastAudiblyAlertedMs = previous.mLastAudiblyAlertedMs; + } + return this; + } + + /** + * @hide + */ public void populate(Ranking other) { populate(other.mKey, other.mRank, 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 423f85f2ddd0..bd65ef06f3a9 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 @@ -282,7 +282,7 @@ public final class NotificationEntry extends ListEntry { + " doesn't match existing key " + mKey); } - mRanking = ranking; + mRanking = ranking.withAudiblyAlertedInfo(mRanking); } /* diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java index 07de388598b7..c43ad36d4462 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java @@ -106,9 +106,9 @@ public abstract class HeadsUpManager extends AlertingNotificationManager { public void updateNotification(@NonNull String key, boolean alert) { super.updateNotification(key, alert); - AlertEntry alertEntry = getHeadsUpEntry(key); - if (alert && alertEntry != null) { - setEntryPinned((HeadsUpEntry) alertEntry, shouldHeadsUpBecomePinned(alertEntry.mEntry)); + HeadsUpEntry headsUpEntry = getHeadsUpEntry(key); + if (alert && headsUpEntry != null) { + setEntryPinned(headsUpEntry, shouldHeadsUpBecomePinned(headsUpEntry.mEntry)); } } |