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

Commit 2d79f634 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug where a notification could get removed

If the following calls were made, the second notification
would disappear even though it should still be around:

1: addNotification(key) (HUN)
2: cancelNotification(key) (<2s after 1.)
3: addNotification(key)

This is now fixed.

Change-Id: Ibe108d60ca92ed076e4f44694a76904fabeee970
parent c6dd5210
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ import android.service.notification.NotificationListenerService;
import android.service.notification.NotificationListenerService.RankingMap;
import android.service.notification.StatusBarNotification;
import android.text.TextUtils;
import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;
import android.util.SparseArray;
@@ -175,6 +176,7 @@ public abstract class BaseStatusBar extends SystemUI implements
    protected boolean mDeviceInteractive;

    protected boolean mVisible;
    protected ArraySet<Entry> mHeadsUpEntriesToRemoveOnSwitch = new ArraySet<>();

    // mScreenOnFromKeyguard && mVisible.
    private boolean mVisibleToUser;
@@ -2016,6 +2018,8 @@ public abstract class BaseStatusBar extends SystemUI implements
        Entry entry = mNotificationData.get(key);
        if (entry == null) {
            return;
        } else if (mHeadsUpEntriesToRemoveOnSwitch.contains(entry)) {
            mHeadsUpEntriesToRemoveOnSwitch.remove(entry);
        }

        Notification n = notification.getNotification();
+0 −1
Original line number Diff line number Diff line
@@ -617,7 +617,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    };
    private HashMap<ExpandableNotificationRow, List<ExpandableNotificationRow>> mTmpChildOrderMap
            = new HashMap<>();
    private HashSet<Entry> mHeadsUpEntriesToRemoveOnSwitch = new HashSet<>();
    private RankingMap mLatestRankingMap;
    private boolean mNoAnimationOnNextBarModeChange;
    private FalsingManager mFalsingManager;