openivi-html5: Fix visibility issues 35/9535/3
authorLeon Anavi <leon.anavi@konsulko.com>
Sat, 27 May 2017 07:45:33 +0000 (10:45 +0300)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tue, 30 May 2017 12:31:55 +0000 (12:31 +0000)
Change the systemd service to user unit, add dependencies, update
the bash script for launching openivi-html5 and fix the visibility
issue to prevent blank screen at startup.

AGL-Bug: SPEC-629

Change-Id: Ibc64088a39a1d7cc2899cb0ff43e8312cde95bc8
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
recipes-openivi/openivi-html5/openivi-html5/openivi-html5.service
recipes-openivi/openivi-html5/openivi-html5/openivi-html5.sh
recipes-openivi/openivi-html5/openivi-html5_git.bb

index df14ccb..2c86484 100644 (file)
@@ -1,14 +1,16 @@
 [Unit]
 Description=HTML5 runtime for OpenIVI Mobility applications
 [Unit]
 Description=HTML5 runtime for OpenIVI Mobility applications
-Requires=dbus.service
-After=dbus.service lightmediascanner.service rygel.service weston.service
+Requires=afm-user-daemon.service InputEventManager.service
+After=afm-user-daemon.service InputEventManager.service
+ConditionKernelCommandLine=!agl.nogfx
 
 [Service]
 
 [Service]
-User=root
+Type=dbus
+BusName=org.agl.openivi
 ExecStart=/usr/bin/openivi-html5.sh
 ExecStart=/usr/bin/openivi-html5.sh
-Restart=always
-RestartSec=2
+Restart=on-failure
+RestartSec=5
 TimeoutStopSec=1
 
 [Install]
 TimeoutStopSec=1
 
 [Install]
-WantedBy=multi-user.target
+WantedBy=default.target
index 3a43b40..a318214 100644 (file)
@@ -30,10 +30,7 @@ SCREEN_H=1920
 QT_W=1080
 QT_H=1920
 
 QT_W=1080
 QT_H=1920
 
-# Ensure that Weston has been fully loaded
-sleep 8
-
-/usr/bin/openivi-html5 -f -u $HOMESCREEN &
+QT_IVI_SURFACE_ID=4194304 QT_WAYLAND_SHELL_INTEGRATION=ivi-shell /usr/bin/openivi-html5 -f -u $HOMESCREEN &
 
 # qmlscene create 2 surfaces
 #   0x80000000 : for off screen buffer ?
 
 # qmlscene create 2 surfaces
 #   0x80000000 : for off screen buffer ?
index 1151719..168b98c 100644 (file)
@@ -16,9 +16,7 @@ PV = "0.1"
 
 S = "${WORKDIR}/git"
 
 
 S = "${WORKDIR}/git"
 
-SYSTEMD_SERVICE_${PN} = "openivi-html5.service"
-
-RDEPENDS_${PN} = "qtbase qtwebkit"
+RDEPENDS_${PN} = "qtbase qtwebkit inputeventmanager windowmanager"
 DEPENDS = "qtbase-native qtbase qtwebkit"
 
 EXTRA_OECMAKE = " -DCMAKE_DISABLE_FIND_PACKAGE_X11=TRUE "
 DEPENDS = "qtbase-native qtbase qtwebkit"
 
 EXTRA_OECMAKE = " -DCMAKE_DISABLE_FIND_PACKAGE_X11=TRUE "
@@ -35,8 +33,11 @@ do_install() {
   install -p -D ${WORKDIR}/openivi-html5.sh ${D}${bindir}/openivi-html5.sh
 
   if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
   install -p -D ${WORKDIR}/openivi-html5.sh ${D}${bindir}/openivi-html5.sh
 
   if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-    install -p -D ${WORKDIR}/openivi-html5.service ${D}${systemd_unitdir}/system/openivi-html5.service
+    install -d ${D}${systemd_user_unitdir}
+    install -p -D ${WORKDIR}/openivi-html5.service ${D}${systemd_user_unitdir}/openivi-html5.service
+    install -d ${D}${sysconfdir}/systemd/user/default.target.wants
+    ln -sf ${systemd_user_unitdir}/openivi-html5.service ${D}${sysconfdir}/systemd/user/default.target.wants
   fi
 }
 
   fi
 }
 
-FILES_${PN} += " ${prefix}/bin/openivi-html5.sh"
+FILES_${PN} += " ${prefix}/bin/openivi-html5.sh ${systemd_user_unitdir} ${sysconfdir}"