From d7474bbe49e2d14290ca1b0cddb746e0bf5fbe63 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 7 Dec 2014 00:04:36 +0100 Subject: implement launcher d-bus commands --- daemon/appmsgmanager.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'daemon/appmsgmanager.cpp') diff --git a/daemon/appmsgmanager.cpp b/daemon/appmsgmanager.cpp index f24b8d9..eda1eb4 100644 --- a/daemon/appmsgmanager.cpp +++ b/daemon/appmsgmanager.cpp @@ -23,6 +23,10 @@ AppMsgManager::AppMsgManager(AppManager *apps, WatchConnector *watch, QObject *p case WatchConnector::appmsgPUSH: handleLauncherPushMessage(data); break; + case WatchConnector::appmsgACK: + case WatchConnector::appmsgNACK: + // TODO we ignore those for now. + break; } return true; @@ -97,12 +101,24 @@ void AppMsgManager::send(const QUuid &uuid, const QVariantMap &data) void AppMsgManager::launchApp(const QUuid &uuid) { - // TODO + WatchConnector::Dict dict; + dict.insert(1, WatchConnector::launcherSTARTED); + + logger()->debug() << "Sending message to launcher" << uuid << dict; + + QByteArray msg = buildPushMessage(++_lastTransactionId, uuid, dict); + watch->sendMessage(WatchConnector::watchLAUNCHER, msg); } void AppMsgManager::closeApp(const QUuid &uuid) { - // TODO + WatchConnector::Dict dict; + dict.insert(1, WatchConnector::launcherSTOPPED); + + logger()->debug() << "Sending message to launcher" << uuid << dict; + + QByteArray msg = buildPushMessage(++_lastTransactionId, uuid, dict); + watch->sendMessage(WatchConnector::watchLAUNCHER, msg); } WatchConnector::Dict AppMsgManager::mapAppKeys(const QUuid &uuid, const QVariantMap &data) -- cgit v1.2.3