From 883ace4eb27ca86b430bdffedfa06abaf61805bc Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 29 Apr 2023 11:25:08 -0400 Subject: [PATCH] Remove unnecessary notification tracking we don't need this whatsoever. We only play animations when the notification is posted, and that's all we ever do. Animating all the time while notifications are there is only annoying. --- .../lunatic/Services/NotificationService.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/net/typeblog/lunatic/Services/NotificationService.java b/src/net/typeblog/lunatic/Services/NotificationService.java index 2260f93..d0829f9 100644 --- a/src/net/typeblog/lunatic/Services/NotificationService.java +++ b/src/net/typeblog/lunatic/Services/NotificationService.java @@ -39,7 +39,6 @@ public class NotificationService extends NotificationListenerService { private static final String TAG = "SpotlightNotification"; private static final boolean DEBUG = true; - private ArrayList mNotifications = new ArrayList<>(); private AnimationManager mAnimationManager; @Override @@ -87,19 +86,7 @@ public class NotificationService extends NotificationListenerService { && !Arrays.asList(Constants.APPSTOIGNORE).contains(packageName) && !Arrays.asList(Constants.NOTIFSTOIGNORE).contains(packageName + ":" + packageChannelID) && (packageImportance >= NotificationManager.IMPORTANCE_DEFAULT || packageImportance == -1)) { - mNotifications.add(sbn.getId()); mAnimationManager.playNotifications(); } } - - @Override - public void onNotificationRemoved(StatusBarNotification sbn){ - if (DEBUG) Log.d(TAG, "onNotificationRemoved: package:" + sbn.getPackageName() + " | channel id: " + sbn.getNotification().getChannelId() + " | id: " + sbn.getId()); - if (mNotifications.contains(sbn.getId())) { - mNotifications.remove((Integer) sbn.getId()); - } - if (mNotifications.isEmpty()) { - mAnimationManager.stopNotifications(); - } - } }