From f3e16c5b1de45befbc2fd6a1e7d5b2eebd2d46e1 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 1 Nov 2018 14:55:14 +0100 Subject: [PATCH] Pebble: Fix regression causing "Open on Phone" and "Dismiss" to appear on Pebble notification with no corresponding Android notification (i.e. PebbleKit notifications) --- .../gadgetbridge/service/devices/pebble/PebbleProtocol.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java index 74aa5b504..2a31534af 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleProtocol.java @@ -485,8 +485,7 @@ public class PebbleProtocol extends GBDeviceProtocol { @Override public byte[] encodeNotification(NotificationSpec notificationSpec) { - //TODO: simplify this logic? is hasHandle still needed? - boolean hasHandle = notificationSpec.getId() != -1 && notificationSpec.phoneNumber == null; + boolean hasHandle = notificationSpec.sourceAppId != null; int id = notificationSpec.getId() != -1 ? notificationSpec.getId() : mRandom.nextInt(); String title; String subtitle = null;