From: Marius Vlad Date: Mon, 17 Jan 2022 11:46:38 +0000 (+0200) Subject: homescreenhandler: Do not attempt to start launcher X-Git-Tag: 12.92.0~3 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=37ba3ff90d878a135e347508505657e3d56c5edd;p=apps%2Fhomescreen.git homescreenhandler: Do not attempt to start launcher Our launcher application is started by systemd as a user session, and attempting to start it again would result into being started once more, but this by applaunchd. Until we merge homescreen and launcher together avoid starting it and just activate it whenever necessary. Bug-AGL: SPEC-4215 Signed-off-by: Marius Vlad Change-Id: I90806457b74a2439cb8bdc88068954eb7ef1d532 --- diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp index 9111ebb..4a8b9cd 100644 --- a/homescreen/src/homescreenhandler.cpp +++ b/homescreen/src/homescreenhandler.cpp @@ -24,6 +24,9 @@ #define APPLAUNCH_DBUS_IFACE "org.automotivelinux.AppLaunch" #define APPLAUNCH_DBUS_OBJECT "/org/automotivelinux/AppLaunch" +/* LAUNCHER_APP_ID shouldn't be started by applaunchd as it is started as a + * user session by systemd */ +#define LAUNCHER_APP_ID "launcher" void* HomescreenHandler::myThis = 0; @@ -63,20 +66,27 @@ getWlOutput(QPlatformNativeInterface *native, QScreen *screen) void HomescreenHandler::tapShortcut(QString application_id) { + QDBusPendingReply<> reply; HMI_DEBUG("HomeScreen","tapShortcut %s", application_id.toStdString().c_str()); - QDBusPendingReply<> reply = applaunch_iface->start(application_id); + if (application_id == LAUNCHER_APP_ID) + goto activate_app; + + reply = applaunch_iface->start(application_id); reply.waitForFinished(); + if (reply.isError()) { HMI_ERROR("HomeScreen","Unable to start application '%s': %s", application_id.toStdString().c_str(), reply.error().message().toStdString().c_str()); - } else { - if (mp_launcher) { - mp_launcher->setCurrent(application_id); - } - appStarted(application_id); + return; + } + +activate_app: + if (mp_launcher) { + mp_launcher->setCurrent(application_id); } + appStarted(application_id); } void HomescreenHandler::appStarted(const QString& application_id)