1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-08-15 20:01:01 +02:00

Pebble: fix wrong uuid being passed from protocol to js

This commit is contained in:
Andreas Shimokawa 2017-08-02 23:09:43 +02:00
parent 9cca16cb00
commit 6916beabed
2 changed files with 3 additions and 3 deletions

View File

@ -2608,7 +2608,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
LOG.info("got APPLICATIONMESSAGE/LAUNCHER (EP " + endpoint + ") NACK");
}
GBDeviceEventAppMessage evtAppMessage = null;
if (idLookup[last_id] != null) {
if (endpoint == ENDPOINT_APPLICATIONMESSAGE && idLookup[last_id] != null) {
evtAppMessage = new GBDeviceEventAppMessage();
if (pebbleCmd == APPLICATIONMESSAGE_ACK) {
evtAppMessage.type = GBDeviceEventAppMessage.TYPE_ACK;
@ -2616,7 +2616,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
evtAppMessage.type = GBDeviceEventAppMessage.TYPE_NACK;
}
evtAppMessage.id = idLookup[last_id];
evtAppMessage.appUUID = uuid;
evtAppMessage.appUUID = currentRunningApp;
}
devEvts = new GBDeviceEvent[]{evtAppMessage};
break;

View File

@ -131,7 +131,7 @@ public class WebViewSingleton {
if (!message.appUUID.equals(currentRunningUUID)) {
LOG.info("WEBVIEW ignoring message for app that is not currently running: " + message.appUUID + " message: " + message.message + " type: " + message.type);
// return; //TODO: ignoring would be the right thing to do here, but sometimes appUUID is apparently wrong
return;
}
// TODO: handle ACK and NACK types with ids