From: Jan-Simon Moeller Date: Fri, 12 May 2017 21:52:40 +0000 (+0000) Subject: Merge "HomeScreenControlInterface: use single afm_user_daemon" X-Git-Tag: 3.99.1~2 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=226982d32f334189b4f465a720a297548a42c077;hp=73837973a94aaae5128953fc69835447face8d98;p=apps%2Fhomescreen.git Merge "HomeScreenControlInterface: use single afm_user_daemon" --- diff --git a/homescreen/src/homescreencontrolinterface.cpp b/homescreen/src/homescreencontrolinterface.cpp index a9a1ba1..ecbe8e4 100644 --- a/homescreen/src/homescreencontrolinterface.cpp +++ b/homescreen/src/homescreencontrolinterface.cpp @@ -14,30 +14,21 @@ * limitations under the License. */ +#include "afm_user_daemon_proxy.h" #include "homescreencontrolinterface.h" +extern org::AGL::afm::user *afm_user_daemon_proxy; + HomeScreenControlInterface::HomeScreenControlInterface(QObject *parent) : QObject(parent), - mp_homeScreenAdaptor(0), - mp_dBusAppFrameworkProxy() + mp_homeScreenAdaptor(0) { // publish dbus homescreen interface mp_homeScreenAdaptor = new HomescreenAdaptor((QObject*)this); + QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.registerObject("/HomeScreen", this); dbus.registerService("org.agl.homescreen"); - - qDebug("D-Bus: connect to org.agl.homescreenappframeworkbindertizen /AppFramework"); - mp_dBusAppFrameworkProxy = new org::agl::appframework("org.agl.homescreenappframeworkbindertizen", - "/AppFramework", - QDBusConnection::sessionBus(), - 0); -} - -HomeScreenControlInterface::~HomeScreenControlInterface() -{ - delete mp_dBusAppFrameworkProxy; - delete mp_homeScreenAdaptor; } QList HomeScreenControlInterface::getAllSurfacesOfProcess(int pid) @@ -60,13 +51,13 @@ void HomeScreenControlInterface::hardKeyPressed(int key) { case InputEvent::HARDKEY_NAV: qDebug("hardKeyPressed NAV key pressed!"); - pid = mp_dBusAppFrameworkProxy->launchApp("navigation@0.1"); + pid = afm_user_daemon_proxy->start("navigation@0.1").value().toInt(); qDebug("pid: %d", pid); emit newRequestsToBeVisibleApp(pid); break; case InputEvent::HARDKEY_MEDIA: qDebug("hardKeyPressed MEDIA key pressed!"); - pid = mp_dBusAppFrameworkProxy->launchApp("media@0.1"); + pid = afm_user_daemon_proxy->start("media@0.1").value().toInt(); qDebug("pid: %d", pid); emit newRequestsToBeVisibleApp(pid); break; diff --git a/homescreen/src/homescreencontrolinterface.h b/homescreen/src/homescreencontrolinterface.h index d3e262d..b68a2b2 100644 --- a/homescreen/src/homescreencontrolinterface.h +++ b/homescreen/src/homescreencontrolinterface.h @@ -20,15 +20,12 @@ #include #include "include/homescreen.hpp" #include "homescreen_adaptor.h" -#include -#include class HomeScreenControlInterface : public QObject { Q_OBJECT public: explicit HomeScreenControlInterface(QObject *parent = 0); - ~HomeScreenControlInterface(); signals: void newRequestsToBeVisibleApp(int pid); @@ -47,9 +44,9 @@ public Q_SLOTS: // METHODS void renderSurfaceToArea(int surfaceId, int layoutArea); bool renderAppToAreaAllowed(int appCategory, int layoutArea); void requestSurfaceIdToFullScreen(int surfaceId); + private: HomescreenAdaptor *mp_homeScreenAdaptor; - org::agl::appframework *mp_dBusAppFrameworkProxy; }; #endif // HOMESCREENCONTROLINTERFACE_H diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp index 59a259e..28a8d38 100644 --- a/homescreen/src/main.cpp +++ b/homescreen/src/main.cpp @@ -26,7 +26,7 @@ #include "applicationlauncher.h" #include "statusbarmodel.h" #include "applicationmodel.h" - +#include "appinfo.h" #include "afm_user_daemon_proxy.h" // XXX: We want this DBus connection to be shared across the different