From 1832692b22c424b457f011956534a4ec7a75b13e Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sat, 26 Jan 2019 16:17:51 +0100 Subject: [PATCH] Skip duplicate notification prevention for apps that do not populate the "when" field, like some Calendar apps. Closes #1397 --- .../gadgetbridge/externalevents/NotificationListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java index c11e96634..95a030fd6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -363,7 +363,11 @@ public class NotificationListener extends NotificationListenerService { mPackageLookup.add(notificationSpec.getId(), sbn.getPackageName()); // for MUTE notificationBurstPrevention.put(source, cur_time); - notificationOldRepeatPrevention.put(source, notification.when); + if(0 != notification.when) { + notificationOldRepeatPrevention.put(source, notification.when); + }else { + LOG.info("This app might show old/duplicate notifications. notification.when is 0 for " + source); + } GBApplication.deviceService().onNotification(notificationSpec); }