Merge "Prevent bell icon from disappearing on immediate followup notification." into rvc-qpr-dev am: a568597191 am: e35f399130
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12099423 Change-Id: Ief08af5a5d4f46c4cbefc84713b0bf2498e687b0
This commit is contained in:
@@ -1935,6 +1935,17 @@ public abstract class NotificationListenerService extends Service {
|
||||
mIsBubble = isBubble;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public @NonNull Ranking withAudiblyAlertedInfo(@Nullable Ranking previous) {
|
||||
if (previous != null && previous.mLastAudiblyAlertedMs > 0
|
||||
&& this.mLastAudiblyAlertedMs <= 0) {
|
||||
this.mLastAudiblyAlertedMs = previous.mLastAudiblyAlertedMs;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
|
||||
@@ -282,7 +282,7 @@ public final class NotificationEntry extends ListEntry {
|
||||
+ " doesn't match existing key " + mKey);
|
||||
}
|
||||
|
||||
mRanking = ranking;
|
||||
mRanking = ranking.withAudiblyAlertedInfo(mRanking);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user