Allow single widget-application package 41/54641/3
authorSangyoon Jang <s89.jang@samsung.com>
Thu, 17 Dec 2015 01:18:14 +0000 (10:18 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Thu, 17 Dec 2015 02:17:15 +0000 (11:17 +0900)
Change-Id: Ibfc33ed793305f0bc73f204a083c8dafd2799d2e
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/tpk/step/step_parse.cc

index 0288800..4085116 100644 (file)
@@ -127,10 +127,14 @@ bool StepParse::FillPackageInfo(manifest_x* manifest) {
   std::shared_ptr<const ServiceApplicationInfoList> service_application_list =
       std::static_pointer_cast<const ServiceApplicationInfoList>(
           parser_->GetManifestData(app_keys::kServiceApplicationKey));
+  std::shared_ptr<const WidgetApplicationInfoList> widget_application_list =
+      std::static_pointer_cast<const WidgetApplicationInfoList>(
+          parser_->GetManifestData(app_keys::kWidgetApplicationKey));
 
   // mandatory check
-  if (!ui_application_list && !service_application_list) {
-    LOG(ERROR) << "UI Application or Service Application "
+  if (!ui_application_list && !service_application_list &&
+      !widget_application_list) {
+    LOG(ERROR) << "UI Application or Service Application or Widget Application "
                   "are mandatory and has not been found.";
     return false;
   }
@@ -168,9 +172,12 @@ bool StepParse::FillPackageInfo(manifest_x* manifest) {
   if (ui_application_list) {
     manifest->mainapp_id =
         strdup(ui_application_list->items[0].ui_info.appid().c_str());
-  } else {
+  } else if (service_application_list) {
     manifest->mainapp_id =
         strdup(service_application_list->items[0].sa_info.appid().c_str());
+  } else if (widget_application_list) {
+    manifest->mainapp_id =
+        strdup(widget_application_list->items[0].widget_info.appid().c_str());
   }
   return true;
 }