Fix for update-period 68/76068/6
authorPiotr Ganicz <p.ganicz@samsung.com>
Wed, 22 Jun 2016 07:51:31 +0000 (09:51 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Thu, 23 Jun 2016 09:25:28 +0000 (02:25 -0700)
Change-Id: Ic8adec0d7bd7aa14a3b5e054aaed67d5cb1d849c

src/wgt/step/pkgmgr/step_generate_xml.cc

index 1148642..1173a85 100644 (file)
@@ -108,7 +108,11 @@ bool WriteWidgetApplicationAttributesAndElements(
 
   xmlTextWriterWriteAttribute(writer, BAD_CAST "main",
       BAD_CAST (appwidget->primary ? "true" : "false"));  // NOLINT
-  xmlTextWriterWriteAttribute(writer, BAD_CAST "update-period", BAD_CAST "0");
+  if (!appwidget->update_period.empty()) {
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "update-period", BAD_CAST
+            std::to_string(static_cast<int>(
+                    appwidget->update_period.front())).c_str());
+  }
 
   for (auto& size : appwidget->content_size) {
     xmlTextWriterStartElement(writer, BAD_CAST "support-size");
@@ -297,7 +301,8 @@ common_installer::Step::Status StepGenerateXml::precheck() {
   }
   if (context_->pkgid.get().empty()) {
     LOG(ERROR) << "pkgid attribute is empty";
-    return Step::Status::PACKAGE_NOT_FOUND;   }
+    return Step::Status::PACKAGE_NOT_FOUND;
+  }
 
   if (!context_->manifest_data.get()->application) {
     LOG(ERROR) << "No application in package";