From 0e1287e38261efe83cdcc0d219d5f79a3f4ed174 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Fri, 9 Dec 2016 23:21:51 +0100 Subject: [PATCH] Pebble: also execute AppMessageHandler.pushMessage() if present when connection gets established This does not have any effect now since pushMessage() is not used in this branch --- .../service/devices/pebble/PebbleProtocol.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 ef3d24e0..579237a6 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 @@ -2230,17 +2230,17 @@ public class PebbleProtocol extends GBDeviceProtocol { switch (pebbleCmd) { case APPLICATIONMESSAGE_PUSH: - if (endpoint == ENDPOINT_LAUNCHER) { - LOG.info("got LAUNCHER PUSH from UUID " + uuid); - break; - } - LOG.info("got APPLICATIONMESSAGE PUSH from UUID " + uuid); - + LOG.info((endpoint == ENDPOINT_LAUNCHER ? "got LAUNCHER PUSH from UUID : " : "got APPLICATIONMESSAGE PUSH from UUID : ") + uuid); AppMessageHandler handler = mAppMessageHandlers.get(uuid); if (handler != null) { if (handler.isEnabled()) { - ArrayList> dict = decodeDict(buf); - devEvts = handler.handleMessage(dict); + if (endpoint == ENDPOINT_APPLICATIONMESSAGE) { + ArrayList> dict = decodeDict(buf); + devEvts = handler.handleMessage(dict); + } + else { + devEvts = handler.pushMessage(); + } } else { devEvts = new GBDeviceEvent[]{null}; }