From b3ba27b7ce4ccd695ea9c63d5f7b83fc1a49782c Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 17 Jan 2022 15:32:32 +0900 Subject: [PATCH] Fix parsing vconf attributes of boot-sequence The format of vconf dependency option is changed. 'vconf-key', 'vconf-value' and 'vconf-type' are added for parsing vconf. Change-Id: Ib927efec0bd0d58bbc48c09620ae46330c11e2d5 Signed-off-by: Hwankyu Jhun --- parser/boot-sequencer/CMakeLists.txt | 1 + parser/boot-sequencer/parser_plugin.cc | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/parser/boot-sequencer/CMakeLists.txt b/parser/boot-sequencer/CMakeLists.txt index 46b11a3..b4818d6 100644 --- a/parser/boot-sequencer/CMakeLists.txt +++ b/parser/boot-sequencer/CMakeLists.txt @@ -14,6 +14,7 @@ TARGET_INCLUDE_DIRECTORIES(${TARGET_BOOT_SEQUENCER_PARSER_PLUGIN} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) APPLY_PKG_CONFIG(${TARGET_BOOT_SEQUENCER_PARSER_PLUGIN} PUBLIC + BUNDLE_DEPS DLOG_DEPS GLIB_DEPS LIBTZPLATFORM_CONFIG_DEPS diff --git a/parser/boot-sequencer/parser_plugin.cc b/parser/boot-sequencer/parser_plugin.cc index fa55b0d..8e50c7c 100644 --- a/parser/boot-sequencer/parser_plugin.cc +++ b/parser/boot-sequencer/parser_plugin.cc @@ -19,6 +19,8 @@ #include #include +#include + #include "log_private.hh" namespace boot_sequencer { @@ -257,9 +259,24 @@ void ParserPlugin::ParseBootSequence(xmlNode* node, AppInfo* app_info) { if (!conflicts.empty()) app_info->SetConflicts(std::move(conflicts)); - auto vconf = GetAttribute(child_node, "vconf"); - if (!vconf.empty()) - app_info->SetVconf(std::move(vconf)); + auto vconf_key = GetAttribute(child_node, "vconf-key"); + if (!vconf_key.empty()) { + auto vconf_value = GetAttribute(child_node, "vconf-value"); + if (vconf_value.empty()) { + _E("vconf-value MUST be set"); + continue; + } + + // 'String', 'Int32', 'Boolean', 'Double' + auto vconf_type = GetAttribute(child_node, "vconf-type"); + tizen_base::Bundle vconf { + { "__VCONF_KEY__", vconf_key }, + { "__VCONF_VALUE__", vconf_value }, + { "__VCONF_TYPE__", vconf_type.empty() ? "String" : vconf_type } + }; + + app_info->SetVconf(reinterpret_cast(vconf.ToRaw().first.get())); + } auto path_exists = GetAttribute(child_node, "path-exists"); if (!path_exists.empty()) -- 2.7.4