1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 21:06:50 +01:00

fix notification lookup crash

This commit is contained in:
dakhnod 2019-10-20 13:11:00 +02:00
parent aeba34cc81
commit b7277f02a6

View File

@ -630,7 +630,12 @@ public class NotificationListener extends NotificationListenerService {
public void onNotificationRemoved(StatusBarNotification sbn) { public void onNotificationRemoved(StatusBarNotification sbn) {
LOG.info("Notification removed: " + sbn.getPackageName()); LOG.info("Notification removed: " + sbn.getPackageName());
int originalId = (int) mNotificationHandleLookup.lookupByValue(sbn.getPostTime()); Object lookupObject = mNotificationHandleLookup.lookupByValue(sbn.getPostTime());;
if(lookupObject == null){
LOG.debug("removed notification not found");
return;
}
int originalId = (int) lookupObject;
if (GBApplication.isRunningLollipopOrLater()) { if (GBApplication.isRunningLollipopOrLater()) {
LOG.info("Notification removed: " + sbn.getPackageName() + ", category: " + sbn.getNotification().category); LOG.info("Notification removed: " + sbn.getPackageName() + ", category: " + sbn.getNotification().category);