Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e35f3991 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Prevent bell icon from disappearing on immediate followup...

Merge "Prevent bell icon from disappearing on immediate followup notification." into rvc-qpr-dev am: a5685971

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12099423

Change-Id: Ic5e0ee6eef7209f4426055601eb851fd305a282f
parents 781f492b a5685971
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1900,6 +1900,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
         */
+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ public final class NotificationEntry extends ListEntry {
                    + " doesn't match existing key " + mKey);
        }

        mRanking = ranking;
        mRanking = ranking.withAudiblyAlertedInfo(mRanking);
    }

    /*
+3 −3
Original line number Diff line number Diff line
@@ -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));
        }
    }