From f68582eb465372ce9706615923e2908afa7f00d8 Mon Sep 17 00:00:00 2001 From: Daniel Dakhno Date: Sat, 22 May 2021 23:32:36 +0200 Subject: [PATCH] Fossil HR: fixed last notification widget --- .../adapter/fossil_hr/FossilHRWatchAdapter.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java index 8b3a12068..0aa001121 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java @@ -969,17 +969,22 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter { } } + boolean packageFound = false; + // Send notification to watch try { for (NotificationHRConfiguration configuration : this.notificationConfigurations) { if (configuration.getPackageName().equals(sourceAppId)) { LOG.info("Package found in notificationConfigurations, using custom icon: " + sourceAppId); queueWrite(new PlayTextNotificationRequest(sourceAppId, senderOrTitle, notificationSpec.body, notificationSpec.getId(), this)); - return true; + packageFound = true; } } - LOG.info("Package not found in notificationConfigurations, using generic icon: " + sourceAppId); - queueWrite(new PlayTextNotificationRequest("generic", senderOrTitle, notificationSpec.body, notificationSpec.getId(), this)); + + if(!packageFound) { + LOG.info("Package not found in notificationConfigurations, using generic icon: " + sourceAppId); + queueWrite(new PlayTextNotificationRequest("generic", senderOrTitle, notificationSpec.body, notificationSpec.getId(), this)); + } } catch (Exception e) { LOG.error("Error while forwarding notification", e); }