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 56f0197c1..4b8fb7c5e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -653,6 +653,12 @@ public class NotificationListener extends NotificationListenerService { notificationSpec.body = sanitizeUnicode(contentCS.toString()); } + if (notificationSpec.type == NotificationType.COL_REMINDER + && notificationSpec.body == null + && notificationSpec.title != null) { + notificationSpec.body = notificationSpec.title; + notificationSpec.title = null; + } } private boolean isServiceRunning() { @@ -883,10 +889,13 @@ public class NotificationListener extends NotificationListenerService { return false; } - private boolean shouldIgnoreOngoing(StatusBarNotification sbn) { + private boolean shouldIgnoreOngoing(StatusBarNotification sbn, NotificationType type) { if (isFitnessApp(sbn)) { return true; } + if (type == NotificationType.COL_REMINDER) { + return true; + } return false; } @@ -932,6 +941,7 @@ public class NotificationListener extends NotificationListenerService { type != NotificationType.WECHAT && type != NotificationType.TELEGRAM && type != NotificationType.OUTLOOK && + type != NotificationType.COL_REMINDER && type != NotificationType.SKYPE) { //see https://github.com/Freeyourgadget/Gadgetbridge/issues/1109 LOG.info("Ignoring notification, local only"); return true; @@ -958,7 +968,7 @@ public class NotificationListener extends NotificationListenerService { } } - if (shouldIgnoreOngoing(sbn)) { + if (shouldIgnoreOngoing(sbn, type)) { return false; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/AppNotificationType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/AppNotificationType.java index 9f1c7312b..ac9817ab2 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/AppNotificationType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/AppNotificationType.java @@ -174,6 +174,9 @@ public class AppNotificationType extends HashMap { // Discord put("com.discord", NotificationType.DISCORD); + + // COL Reminder + put("com.colapps.reminder", NotificationType.COL_REMINDER); } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java index e0ee3ff88..3b1c93be6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java @@ -72,7 +72,8 @@ public enum NotificationType { VIBER(PebbleIconID.NOTIFICATION_VIBER, PebbleColor.VividViolet), WECHAT(PebbleIconID.NOTIFICATION_WECHAT, PebbleColor.KellyGreen), WHATSAPP(PebbleIconID.NOTIFICATION_WHATSAPP, PebbleColor.IslamicGreen), - YAHOO_MAIL(PebbleIconID.NOTIFICATION_YAHOO_MAIL, PebbleColor.Indigo); + YAHOO_MAIL(PebbleIconID.NOTIFICATION_YAHOO_MAIL, PebbleColor.Indigo), + COL_REMINDER(PebbleIconID.NOTIFICATION_REMINDER, PebbleColor.IslamicGreen); // Note: if you add any more constants, update all clients as well @@ -134,6 +135,7 @@ public enum NotificationType { case OUTLOOK: case YAHOO_MAIL: return "generic_email"; + case COL_REMINDER: case UNKNOWN: default: return "generic";