Adjust parsing component-based application 38/203138/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 10 Apr 2019 06:25:01 +0000 (15:25 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 10 Apr 2019 06:25:01 +0000 (15:25 +0900)
FillComponentInfo step is removed.
FillAppControl, FillDataControl, FillMetadata, FillCategories and
FillSplashScreen are added.

Change-Id: I3c47918f04def3015f20df800005d88850cb8198
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/common/step/configuration/step_parse_manifest.cc
src/common/step/configuration/step_parse_manifest.h

index 09a90ad..52f9377 100644 (file)
@@ -228,16 +228,6 @@ bool StepParseManifest::FillPackageInfo(manifest_x* manifest) {
                   "are mandatory and has not been found.";
     return false;
   }
-  if (component_based_application_list) {
-    for (const auto& app : component_based_application_list->items) {
-      if (app.components.components().empty()) {
-        LOG(ERROR) << "Frame-Component or Service-Component is mandatory and "
-                      "has not been found.";
-        return false;
-      }
-    }
-  }
-
 
   int support_mode_val = GetSupportModeVal(pkg_info->support_mode());
 
@@ -1191,27 +1181,6 @@ bool StepParseManifest::FillExtraInfo(manifest_x* manifest) {
   return true;
 }
 
-template <typename T>
-bool StepParseManifest::FillComponentInfo(application_x* app,
-                                          const T& component_list) {
-  for (auto& component : component_list.components()) {
-    component_x* comp =
-        static_cast<component_x*>(calloc(1, sizeof(component_x)));
-    if (!comp) {
-      LOG(ERROR) << "Out of memory";
-      return false;
-    }
-
-    comp->id = strdup(component.id().c_str());
-    comp->type = strdup(component.type().c_str());
-    comp->launch_mode = strdup(component.launch_mode().c_str());
-
-    app->components = g_list_append(app->components, comp);
-  }
-
-  return true;
-}
-
 bool StepParseManifest::FillComponentBasedApplicationInfo(
     manifest_x* manifest) {
   std::shared_ptr<const tpk::parse::ComponentBasedApplicationInfoList>
@@ -1264,6 +1233,8 @@ bool StepParseManifest::FillComponentBasedApplicationInfo(
     app->support_disable = strdup(manifest->support_disable);
     app->launch_mode = strdup("single");
     app->api_version = strdup(manifest->api_version);
+    app->splash_screen_display =
+        strdup(application.app_info.splash_screen_display().c_str());
     manifest->application = g_list_append(manifest->application, app);
     if (bf::path(application.app_info.exec().c_str()).is_absolute()) {
       app->exec = strdup(application.app_info.exec().c_str());
@@ -1278,7 +1249,15 @@ bool StepParseManifest::FillComponentBasedApplicationInfo(
       return false;
     if (!FillBackgroundCategoryInfo(app, application.background_category))
       return false;
-    if (!FillComponentInfo(app, application.components))
+    if (!FillAppControl(app, application.app_control))
+      return false;
+    if (!FillDataControl(app, application.data_control))
+      return false;
+    if (!FillMetadata(app, application.meta_data))
+      return false;
+    if (!FillCategories(app, application.categories))
+      return false;
+    if (!FillSplashScreen(app, application.app_splashscreens))
       return false;
   }
 
index 9959113..fe22b7d 100644 (file)
@@ -104,9 +104,6 @@ class StepParseManifest : public common_installer::Step {
   template <typename T>
   bool FillSplashScreen(application_x* app,
       const T& splashscreen_list);
-  template <typename T>
-  bool FillComponentInfo(application_x* app,
-      const T& component_list);
   bool FillExtraInfo(manifest_x* manifest);
   bool FillManifestX(manifest_x* manifest);