Pebble: Propagate watch apps launches outside of PebbleProtocol

This does not do anything yet.
This commit is contained in:
Andreas Shimokawa 2016-12-11 20:25:46 +01:00
parent daf6d12c62
commit 31122f0b09
3 changed files with 24 additions and 4 deletions

View File

@ -12,12 +12,14 @@ public class GBDeviceEventAppManagement extends GBDeviceEvent {
UNKNOWN,
INSTALL,
DELETE,
START,
STOP,
}
public enum Event {
UNKNOWN,
SUCCESS,
ACKNOLEDGE,
ACKNOWLEDGE,
FAILURE,
REQUEST,
}

View File

@ -562,6 +562,9 @@ class PebbleIoThread extends GBDeviceIoThread {
break;
}
break;
case START:
LOG.info("got GBDeviceEventAppManagement START event for uuid: " + appMgmt.uuid);
break;
default:
break;
}

View File

@ -1915,7 +1915,13 @@ public class PebbleProtocol extends GBDeviceProtocol {
if (handler != null) {
return handler.pushMessage();
}
break;
else {
GBDeviceEventAppManagement gbDeviceEventAppManagement = new GBDeviceEventAppManagement();
gbDeviceEventAppManagement.uuid = uuid;
gbDeviceEventAppManagement.type = GBDeviceEventAppManagement.EventType.START;
gbDeviceEventAppManagement.event = GBDeviceEventAppManagement.Event.SUCCESS;
return new GBDeviceEvent[] {gbDeviceEventAppManagement};
}
case APPRUNSTATE_STOP:
LOG.info(ENDPOINT_NAME + ": stopped " + uuid);
break;
@ -2246,9 +2252,18 @@ public class PebbleProtocol extends GBDeviceProtocol {
}
} else {
try {
devEvts = decodeDictToJSONAppMessage(uuid, buf);
if (endpoint == ENDPOINT_APPLICATIONMESSAGE) {
devEvts = decodeDictToJSONAppMessage(uuid, buf);
}
else {
GBDeviceEventAppManagement gbDeviceEventAppManagement = new GBDeviceEventAppManagement();
gbDeviceEventAppManagement.uuid = uuid;
gbDeviceEventAppManagement.type = GBDeviceEventAppManagement.EventType.START;
gbDeviceEventAppManagement.event = GBDeviceEventAppManagement.Event.SUCCESS;
devEvts = new GBDeviceEvent[] {gbDeviceEventAppManagement};
}
} catch (JSONException e) {
e.printStackTrace();
LOG.error(e.getMessage());
return null;
}
}