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 <marius.vlad@collabora.com>
Change-Id: I90806457b74a2439cb8bdc88068954eb7ef1d532
#define APPLAUNCH_DBUS_IFACE "org.automotivelinux.AppLaunch"
#define APPLAUNCH_DBUS_OBJECT "/org/automotivelinux/AppLaunch"
#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;
void* HomescreenHandler::myThis = 0;
void HomescreenHandler::tapShortcut(QString application_id)
{
void HomescreenHandler::tapShortcut(QString application_id)
{
+ QDBusPendingReply<> reply;
HMI_DEBUG("HomeScreen","tapShortcut %s", application_id.toStdString().c_str());
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);
if (reply.isError()) {
HMI_ERROR("HomeScreen","Unable to start application '%s': %s",
application_id.toStdString().c_str(),
reply.error().message().toStdString().c_str());
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)
}
void HomescreenHandler::appStarted(const QString& application_id)