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
This commit is contained in:
parent
388c47ea29
commit
0e1287e382
|
@ -2230,17 +2230,17 @@ public class PebbleProtocol extends GBDeviceProtocol {
|
||||||
|
|
||||||
switch (pebbleCmd) {
|
switch (pebbleCmd) {
|
||||||
case APPLICATIONMESSAGE_PUSH:
|
case APPLICATIONMESSAGE_PUSH:
|
||||||
if (endpoint == ENDPOINT_LAUNCHER) {
|
LOG.info((endpoint == ENDPOINT_LAUNCHER ? "got LAUNCHER PUSH from UUID : " : "got APPLICATIONMESSAGE PUSH from UUID : ") + uuid);
|
||||||
LOG.info("got LAUNCHER PUSH from UUID " + uuid);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
LOG.info("got APPLICATIONMESSAGE PUSH from UUID " + uuid);
|
|
||||||
|
|
||||||
AppMessageHandler handler = mAppMessageHandlers.get(uuid);
|
AppMessageHandler handler = mAppMessageHandlers.get(uuid);
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
if (handler.isEnabled()) {
|
if (handler.isEnabled()) {
|
||||||
|
if (endpoint == ENDPOINT_APPLICATIONMESSAGE) {
|
||||||
ArrayList<Pair<Integer, Object>> dict = decodeDict(buf);
|
ArrayList<Pair<Integer, Object>> dict = decodeDict(buf);
|
||||||
devEvts = handler.handleMessage(dict);
|
devEvts = handler.handleMessage(dict);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
devEvts = handler.pushMessage();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
devEvts = new GBDeviceEvent[]{null};
|
devEvts = new GBDeviceEvent[]{null};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue