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
This commit is contained in:
@@ -1900,6 +1900,17 @@ public abstract class NotificationListenerService extends Service {
|
|||||||
mIsBubble = isBubble;
|
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
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public final class NotificationEntry extends ListEntry {
|
|||||||
+ " doesn't match existing key " + mKey);
|
+ " 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) {
|
public void updateNotification(@NonNull String key, boolean alert) {
|
||||||
super.updateNotification(key, alert);
|
super.updateNotification(key, alert);
|
||||||
AlertEntry alertEntry = getHeadsUpEntry(key);
|
HeadsUpEntry headsUpEntry = getHeadsUpEntry(key);
|
||||||
if (alert && alertEntry != null) {
|
if (alert && headsUpEntry != null) {
|
||||||
setEntryPinned((HeadsUpEntry) alertEntry, shouldHeadsUpBecomePinned(alertEntry.mEntry));
|
setEntryPinned(headsUpEntry, shouldHeadsUpBecomePinned(headsUpEntry.mEntry));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user