From 33b175854a82941d827c6bc588058fa6125a25b5 Mon Sep 17 00:00:00 2001 From: mamutcho Date: Fri, 13 Mar 2020 20:43:41 +0200 Subject: [PATCH] Fix alarm notification --- .../gadgetbridge/externalevents/NotificationListener.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 18b2780ea..592839529 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -283,8 +283,10 @@ public class NotificationListener extends NotificationListenerService { } if (shouldIgnoreNotification(sbn)) { - LOG.info("Ignoring notification"); - return; + if (!"com.sec.android.app.clockpackage".equals(sbn.getPackageName())) { // workaround to allow phone alarm notification + LOG.info("Ignore notification: " + sbn.getPackageName()); // need to fix + return; + } } String source = sbn.getPackageName().toLowerCase(); @@ -794,7 +796,7 @@ public class NotificationListener extends NotificationListenerService { if (!prefs.getBoolean("notifications_generic_whenscreenon", false)) { PowerManager powermanager = (PowerManager) getSystemService(POWER_SERVICE); if (powermanager != null && powermanager.isScreenOn()) { -// LOG.info("Not forwarding notification, screen seems to be on and settings do not allow this"); + LOG.info("Not forwarding notification, screen seems to be on and settings do not allow this"); return true; } }