Fix parsing vconf attributes of boot-sequence 97/269497/3
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 17 Jan 2022 06:32:32 +0000 (15:32 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Thu, 20 Jan 2022 07:32:20 +0000 (07:32 +0000)
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 <h.jhun@samsung.com>
parser/boot-sequencer/CMakeLists.txt
parser/boot-sequencer/parser_plugin.cc

index 46b11a3..b4818d6 100644 (file)
@@ -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
index fa55b0d..8e50c7c 100644 (file)
@@ -19,6 +19,8 @@
 #include <pkgmgr_installer_info.h>
 #include <unistd.h>
 
+#include <bundle_cpp.h>
+
 #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<char*>(vconf.ToRaw().first.get()));
+      }
 
       auto path_exists = GetAttribute(child_node, "path-exists");
       if (!path_exists.empty())