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

Commit 35c443bd authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

DO NOT MERGE: Don't let NotificationEntryManager keep around old RankingMaps am: 323ce620

Change-Id: I83100c671931304bc515fb9b4510e5df251b8288
parents 62a05662 323ce620
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@ public class NotificationEntryManager implements
    private NotificationRowBinder mNotificationRowBinder;

    private NotificationPresenter mPresenter;
    private NotificationListenerService.RankingMap mLatestRankingMap;
    @VisibleForTesting
    protected NotificationData mNotificationData;

@@ -163,8 +162,7 @@ public class NotificationEntryManager implements
    /** Adds a {@link NotificationLifetimeExtender}. */
    public void addNotificationLifetimeExtender(NotificationLifetimeExtender extender) {
        mNotificationLifetimeExtenders.add(extender);
        extender.setCallback(key -> removeNotification(key, mLatestRankingMap,
                UNDEFINED_DISMISS_REASON));
        extender.setCallback(key -> removeNotification(key, null, UNDEFINED_DISMISS_REASON));
    }

    public NotificationData getNotificationData() {
@@ -302,7 +300,6 @@ public class NotificationEntryManager implements
            if (!forceRemove && !entryDismissed) {
                for (NotificationLifetimeExtender extender : mNotificationLifetimeExtenders) {
                    if (extender.shouldExtendLifetime(entry)) {
                        mLatestRankingMap = ranking;
                        extendLifetime(entry, extender);
                        lifetimeExtended = true;
                        break;
+3 −0
Original line number Diff line number Diff line
@@ -201,6 +201,9 @@ public class NotificationData {
            removed = mEntries.remove(key);
        }
        if (removed == null) return null;
        // NEM may pass us a null ranking map if removing a lifetime-extended notification,
        // so use the most recent ranking
        if (ranking == null) ranking = mRankingMap;
        mGroupManager.onEntryRemoved(removed);
        updateRankingAndSort(ranking);
        return removed;