mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Ignore notifications that are older than 1 second
In case of grouped notifications, we get multiple notifications also if the android device shows only one. This means that with this change the most recently updated chat will get through, but others will not. This should help with #1062 and #657
This commit is contained in:
+4
@@ -209,6 +209,10 @@ public class NotificationListener extends NotificationListenerService {
|
||||
|
||||
String source = sbn.getPackageName().toLowerCase();
|
||||
Notification notification = sbn.getNotification();
|
||||
if (notification.when < (sbn.getPostTime() - 1000)) {
|
||||
LOG.info("NOT processing notification, too old. notification.when: " + notification.when + " post time: " + sbn.getPostTime() + " now: " + System.currentTimeMillis());
|
||||
return;
|
||||
}
|
||||
NotificationSpec notificationSpec = new NotificationSpec();
|
||||
notificationSpec.id = (int) sbn.getPostTime(); //FIXME: a truly unique id would be better
|
||||
|
||||
|
||||
Reference in New Issue
Block a user