1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2025-01-30 11:37:33 +01:00

Fix alarm notification

This commit is contained in:
mamutcho 2020-03-13 20:43:41 +02:00
parent 01f716df83
commit 33b175854a

View File

@ -283,8 +283,10 @@ public class NotificationListener extends NotificationListenerService {
} }
if (shouldIgnoreNotification(sbn)) { if (shouldIgnoreNotification(sbn)) {
LOG.info("Ignoring notification"); if (!"com.sec.android.app.clockpackage".equals(sbn.getPackageName())) { // workaround to allow phone alarm notification
return; LOG.info("Ignore notification: " + sbn.getPackageName()); // need to fix
return;
}
} }
String source = sbn.getPackageName().toLowerCase(); String source = sbn.getPackageName().toLowerCase();
@ -794,7 +796,7 @@ public class NotificationListener extends NotificationListenerService {
if (!prefs.getBoolean("notifications_generic_whenscreenon", false)) { if (!prefs.getBoolean("notifications_generic_whenscreenon", false)) {
PowerManager powermanager = (PowerManager) getSystemService(POWER_SERVICE); PowerManager powermanager = (PowerManager) getSystemService(POWER_SERVICE);
if (powermanager != null && powermanager.isScreenOn()) { 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; return true;
} }
} }