Change-Id: I0b6089b2560c61748cdf7b56a5dc0c627c64ad75
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
--- /dev/null
+#!/bin/sh
+
+x=`grep X-AFM--http-port= /var/local/lib/systemd/user/*agl-identity*.service | sed s/.*=//`
+export IDENTITY_WEBSOCKET="ws://localhost:$x/api?token=HELLO"
+
+exec /usr/AGL/homescreen/HomeScreen
Requires=dbus.service afm-user-daemon.service InputEventManager.service HomeScreenAppFrameworkBinderAGL.service
After=dbus.service afm-user-daemon.service InputEventManager.service HomeScreenAppFrameworkBinderAGL.service WindowManager.service
ConditionKernelCommandLine=!agl.nogfx
Requires=dbus.service afm-user-daemon.service InputEventManager.service HomeScreenAppFrameworkBinderAGL.service
After=dbus.service afm-user-daemon.service InputEventManager.service HomeScreenAppFrameworkBinderAGL.service WindowManager.service
ConditionKernelCommandLine=!agl.nogfx
+Requires=afm-service-agl-identity-service@0.1.service
+After=afm-service-agl-identity-service@0.1.service
[Service]
Type=dbus
BusName=org.agl.homescreen
[Service]
Type=dbus
BusName=org.agl.homescreen
-ExecStart=/usr/AGL/homescreen/HomeScreen
+ExecStart=/usr/AGL/homescreen/HomeScreen.launch
# 4194304(= 1 << 22) is special surface id for HomeScreen
Environment=QT_IVI_SURFACE_ID=4194304 QT_WAYLAND_SHELL_INTEGRATION=ivi-shell LD_PRELOAD=/usr/lib/libEGL.so.1
Restart=on-failure
# 4194304(= 1 << 22) is special surface id for HomeScreen
Environment=QT_IVI_SURFACE_ID=4194304 QT_WAYLAND_SHELL_INTEGRATION=ivi-shell LD_PRELOAD=/usr/lib/libEGL.so.1
Restart=on-failure
#include "usermanagement.h"
#include <QDebug>
#include <QtCore/QJsonDocument>
#include "usermanagement.h"
#include <QDebug>
#include <QtCore/QJsonDocument>
void UserManagement::connectWebsockets()
{
#ifdef REAL_SERVER
void UserManagement::connectWebsockets()
{
#ifdef REAL_SERVER
- const QUrl url(REAL_SERVER);
+ const QUrl url(getenv("IDENTITY_WEBSOCKET") ?: REAL_SERVER);
#else
const QUrl url(QStringLiteral("ws://localhost:1234"));
#endif
#else
const QUrl url(QStringLiteral("ws://localhost:1234"));
#endif