diff --git a/recipes-openharmony/openharmony/files/media.service b/recipes-openharmony/openharmony/files/media.service new file mode 100644 index 0000000000000000000000000000000000000000..c592e01fbd5ecfa968085880f4927f9373080a98 --- /dev/null +++ b/recipes-openharmony/openharmony/files/media.service @@ -0,0 +1,10 @@ +[Unit] +Description=OpenHarmony media service + +[Service] +Type=oneshot +ExecStart=/bin/echo "OpenHarmony Media Service" +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/recipes-openharmony/openharmony/files/openharmony-preinit b/recipes-openharmony/openharmony/files/openharmony-preinit index 4ca1d5c4258b589f44bf2819477494c07e1ec1ee..51527e19f6bcd3cebb72654ddc0f66fe5538f85b 100644 --- a/recipes-openharmony/openharmony/files/openharmony-preinit +++ b/recipes-openharmony/openharmony/files/openharmony-preinit @@ -271,6 +271,16 @@ if systemctl -q is-enabled foundation.service; then sleep "$STARTUP_CMD_SLEEP" fi +# trigger: boot +# "name" : "media_service", +# "path" : ["/system/bin/sa_main", "/system/profile/media_service.xml"], +# "uid" : "system", +# "gid" : ["media_rw", "system"] +if systemctl -q is-enabled media.service; then + /system/bin/sa_main /system/profile/media_service.xml & + sleep "$STARTUP_CMD_SLEEP" +fi + # trigger: boot # "name" : "inputmethod_service", # "path" : ["/system/bin/sa_main", "/system/profile/inputmethod_service.xml"], diff --git a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb index 324d8c40dc9f759bba72b351ee459f2e791f3a6b..c3d8b2fd47183aebc44706b179514c17d388ec0b 100644 --- a/recipes-openharmony/openharmony/openharmony-standard_3.0.bb +++ b/recipes-openharmony/openharmony/openharmony-standard_3.0.bb @@ -1368,6 +1368,13 @@ FILES:${PN}-multimedia-media = " \ ${libdir}/module/multimedia/libmedia*${SOLIBS} \ ${libdir}/openharmony/profile/media_service.xml \ " +SYSTEMD_PACKAGES += "${PN}-multimedia-media" +SYSTEMD_SERVICE:${PN}-multimedia-media = "media.service" +SRC_URI += "file://media.service" +do_install:append() { + install -d ${D}/${systemd_unitdir}/system + install -m 644 ${WORKDIR}/media.service ${D}${systemd_unitdir}/system/ +} RDEPENDS:${PN}-multimedia-media += "musl libcxx" RDEPENDS:${PN}-multimedia-media += "${PN}-hilog ${PN}-libutils ${PN}-ipc ${PN}-samgr ${PN}-safwk ${PN}-graphic ${PN}-peripheral-display" RDEPENDS:${PN}-multimedia-media += "${PN}-multimedia-audio ${PN}-thirdparty-gstreamer ${PN}-thirdparty-glib ${PN}-syspara ${PN}-ace-napi"