Modify boot sequence parser 99/302099/2
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 30 Nov 2023 07:50:36 +0000 (16:50 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 30 Nov 2023 07:58:49 +0000 (16:58 +0900)
After this patch is applied, the parser does not check on-boot option.
It only checks the boot-sequence exists in the tizen-manifest.xml or not.
The dotnet API version has been integrated into the Tizen API version.

Change-Id: I8eed1c8fa537cc6dad0237cb034c61ed06823309
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
parser/boot-sequencer/parser_plugin.cc

index 641e34a..ceff9d6 100644 (file)
@@ -32,7 +32,6 @@ namespace boot_sequencer {
 namespace {
 
 constexpr const char REQUIRED_API_VERSION[] = "7";
-constexpr const char REQUIRED_DOTNET_API_VERSION[] = "10";
 
 std::string GetName(xmlNode* node) {
   if (node == nullptr)
@@ -79,13 +78,7 @@ bool IsSupported(const std::string& appid, uid_t uid) {
   if (ret != PMINFO_R_OK)
     return false;
 
-  const char* required_api_version;
-  if (strstr(apptype, "dotnet") != nullptr)
-    required_api_version = REQUIRED_DOTNET_API_VERSION;
-  else
-    required_api_version = REQUIRED_API_VERSION;
-
-  if (strverscmp(required_api_version, api_version) <= 0)
+  if (strverscmp(REQUIRED_API_VERSION, api_version) <= 0)
     return true;
 
   return false;
@@ -257,31 +250,30 @@ int ParserPlugin::Parse() {
     if (appid.empty())
       continue;
 
-    std::string onboot = GetAttribute(node, "on-boot");
-    if (onboot != "true")
-      continue;
-
     std::string comp_type = GetName(node);
-    if (comp_type == "ui-application") {
-      if (!IsSupported(appid, GetTargetUid()))
-        continue;
-    }
+    if (comp_type == "widget-application" || comp_type == "watch-application")
+      continue;
 
-    auto app_info = new (std::nothrow) AppInfo(appid);
-    if (app_info == nullptr) {
-      _E("Out of memory");
-      return -1;
-    }
+    if (!IsSupported(appid, GetTargetUid())) continue;
 
+    AppInfo* app_info = nullptr;
     for (xmlNode* child_node = node->children; child_node;
          child_node = child_node->next) {
       std::string name = GetName(child_node);
       if (name != "boot-sequence")
         continue;
 
+      app_info = new (std::nothrow) AppInfo(appid);
+      if (app_info == nullptr) {
+        _E("Out of memory");
+        return -1;
+      }
+
       ParseBootSequence(child_node, app_info);
+      break;
     }
 
+    if (app_info == nullptr) continue;
     args_->Push(std::shared_ptr<AppInfo>(app_info));
   }