Skip to content

Commit

Permalink
Shade: Disable notification filter for MediaListener
Browse files Browse the repository at this point in the history
  • Loading branch information
amirzaidi committed May 23, 2020
1 parent bf36d7a commit 1707aa4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions shade/src/amirz/unread/notifications/NotificationList.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ public NotificationList(HideTracker hideTracker, Handler workerHandler, Runnable
}

public Map<StatusBarNotification, Integer> getMap() {
return getMap(Integer.MIN_VALUE);
return getMap(Integer.MIN_VALUE, true);
}

public Map<StatusBarNotification, Integer> getMap(int minPriority) {
return getMap(minPriority, false);
}

// Warning: Call getMap only from the worker thread, to prevent modification to mSbn.
Map<StatusBarNotification, Integer> getMap(int minPriority) {
private Map<StatusBarNotification, Integer> getMap(int minPriority, boolean all) {
NotificationListener nls = NotificationListener.getInstanceIfConnected();
if (nls == null) {
return Collections.emptyMap();
Expand All @@ -63,7 +67,7 @@ Map<StatusBarNotification, Integer> getMap(int minPriority) {
= nls.getNotificationsForKeys(new ArrayList<>(rankedKeys.keySet()));

for (StatusBarNotification sbn : sbnList) {
if (map.getRanking(sbn.getKey(), mTempRanking) && !shouldBeFilteredOut(sbn)) {
if (map.getRanking(sbn.getKey(), mTempRanking) && (all || !shouldBeFilteredOut(sbn))) {
rankedSbn.put(sbn, getRankedImportance());
}
}
Expand Down

0 comments on commit 1707aa4

Please sign in to comment.