aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2018-07-19 13:33:13 +0000
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2018-07-19 14:34:27 +0000
commit5bf038936a9759cc1634a18efd946ce5ecf10660 (patch)
treec20a52a6ec2d90731b8ebd6a29c80288d7aa7a4c
parentcde1f8b32286b263040cd1d9360f4b8835699505 (diff)
[HACK] Resolve race condition when bootingflounder_5.99.2flounder/5.99.25.99.2
If HomeScreen comes after Launcher is launched, HomeScreen will miss all app's icons. This hack is for resolving the race condition between HomeScreen and Launcher when system booting. Time of delay can be adjust by environment variable, 'HMI_LAUNCHER_STARTUP_DELAY'. The default delay time is 1 sec. Bug-AGL: SPEC-1471 Change-Id: Ied744c3e322203e66dd17d68dd783ad8f5cd3880 Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
-rw-r--r--launcher/src/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp
index 50f1303..ea3ed74 100644
--- a/launcher/src/main.cpp
+++ b/launcher/src/main.cpp
@@ -22,6 +22,7 @@
#include <QtQml/QQmlContext>
#include <QtQml/qqml.h>
#include <QQuickWindow>
+#include <QThread>
#include <qlibwindowmanager.h>
#include "applicationlauncher.h"
@@ -143,6 +144,16 @@ int main(int argc, char *argv[])
query.addQueryItem(QStringLiteral("token"), token);
bindingAddress.setQuery(query);
+ const QByteArray hack_delay = qgetenv("HMI_LAUNCHER_STARTUP_DELAY");
+ int delay_time = 1;
+
+ if (!hack_delay.isEmpty()) {
+ delay_time = (QString::fromLocal8Bit(hack_delay)).toInt();
+ }
+
+ QThread::sleep(delay_time);
+ qDebug("Sleep %d sec to resolve race condtion between HomeScreen and Launcher", delay_time);
+
// mail.qml loading
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("layoutHandler", layoutHandler);