1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-29 03:55:49 +01:00

Rebuild notification handling to work with postTime() instead of getId()

This commit is contained in:
Andreas Böhler 2020-11-20 13:17:58 +01:00 committed by Gitea
parent 80df573ccf
commit 4fd904d33f

View File

@ -317,7 +317,7 @@ public class NotificationListener extends NotificationListenerService {
}
}
NotificationSpec notificationSpec = new NotificationSpec(sbn.getId());
NotificationSpec notificationSpec = new NotificationSpec();
// determinate Source App Name ("Label")
String name = getAppName(source);
@ -724,7 +724,11 @@ public class NotificationListener extends NotificationListenerService {
Prefs prefs = GBApplication.getPrefs();
if (prefs.getBoolean("autoremove_notifications", true)) {
LOG.info("notification removed, will ask device to delete it");
GBApplication.deviceService().onDeleteNotification(sbn.getId());
Object o = mNotificationHandleLookup.lookupByValue(sbn.getPostTime());
if(o != null) {
int id = (int) o;
GBApplication.deviceService().onDeleteNotification(id);
}
}
}