Fix parsing vconf attributes of boot-sequence
[platform/core/appfw/aul-1.git] / parser / boot-sequencer / parser_plugin.cc
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())