#include <common/utils/glist_range.h>
#include <manifest_parser/utils/version_number.h>
#include <wgt_manifest_handlers/account_handler.h>
+#include <wgt_manifest_handlers/addon_handler.h>
#include <wgt_manifest_handlers/app_control_handler.h>
#include <wgt_manifest_handlers/appdefined_privilege_handler.h>
#include <wgt_manifest_handlers/application_icons_handler.h>
auto app_info =
GetManifestDataForKey<const wgt::parse::TizenApplicationInfo>(
app_keys::kTizenApplicationKey);
- if (!app_info) {
- LOG(ERROR) << "Application info manifest data has not been found.";
- return false;
- }
+ if (!app_info.get())
+ return true;
auto icons_info =
GetManifestDataForKey<const wgt::parse::ApplicationIconsInfo>(
app_keys::kIconsKey);
manifest->nodisplay_setting = strdup("false");
manifest->installed_storage = strdup("installed_internal");
- // For wgt package use the long name
- application_x* app =
- reinterpret_cast<application_x*>(manifest->application->data);
- for (auto& item : wgt_info->name_set()) {
- AppendLabel(app, item.second, item.first);
+ if (manifest->application) {
+ // For wgt package use the long name
+ application_x* app =
+ reinterpret_cast<application_x*>(manifest->application->data);
+ for (auto& item : wgt_info->name_set()) {
+ AppendLabel(app, item.second, item.first);
+ }
}
author_x* author = reinterpret_cast<author_x*>(calloc(1, sizeof(author_x)));
auto app_info =
GetManifestDataForKey<const wgt::parse::TizenApplicationInfo>(
app_keys::kTizenApplicationKey);
- if (!app_info) {
- LOG(ERROR) << "Application info manifest data has not been found.";
- return false;
- }
+ if (!app_info.get())
+ return true;
bool has_watch_category = false;
bool has_ime = false;
bool has_downloadable_font = false;
return true;
}
+bool StepParse::FillAddonInfo(manifest_x* manifest) {
+ auto addon_info = GetManifestDataForKey<const wgt::parse::AddonInfo>(
+ app_keys::kTizenAddonKey);
+ if (!addon_info)
+ return true;
+
+ char *pkg = strdup(addon_info->package().c_str());
+ if (!pkg)
+ return false;
+
+ manifest->package = pkg;
+
+ return true;
+}
+
bool StepParse::FillServiceApplicationInfo(manifest_x* manifest) {
auto service_list =
GetManifestDataForKey<const wgt::parse::ServiceList>(
return true;
}
-
bool StepParse::FillBackgroundCategoryInfo(manifest_x* manifest) {
auto manifest_data = parser_->GetManifestData(
app_keys::kTizenBackgroundCategoryKey);
if (!bc_list)
return true;
+ if (!manifest->application)
+ return true;
+
application_x* app =
reinterpret_cast<application_x*>(manifest->application->data);
GetManifestDataForKey<const wgt::parse::AppControlInfoList>(
app_keys::kTizenApplicationAppControlsKey);
+ if (!manifest->application)
+ return true;
+
application_x* app =
reinterpret_cast<application_x*>(manifest->application->data);
if (app_info_list) {
if (!category_info)
return true;
+ if (!manifest->application)
+ return true;
+
application_x* app =
reinterpret_cast<application_x*>(manifest->application->data);
// there is one app atm
return false;
if (!FillMainApplicationInfo(manifest))
return false;
+ if (!FillAddonInfo(manifest))
+ return false;
if (!FillWidgetInfo(manifest))
return false;
if (!FillInstallationInfo(manifest))
}
} else {
// making backup of content data and services content data
- auto content_info =
- GetManifestDataForKey<const wgt::parse::ContentInfo>(
- wgt::application_widget_keys::kTizenContentKey);
- auto service_list =
- GetManifestDataForKey<const wgt::parse::ServiceList>(
- wgt::application_widget_keys::kTizenServiceKey);
+ auto content_info = GetManifestDataForKey<const wgt::parse::ContentInfo>(
+ app_keys::kTizenContentKey);
+ auto service_list = GetManifestDataForKey<const wgt::parse::ServiceList>(
+ app_keys::kTizenServiceKey);
if (content_info)
backend_data->content.set(*content_info);
if (service_list)
}
// Copy data from ManifestData to InstallerContext
- auto info =
- GetManifestDataForKey<const wgt::parse::TizenApplicationInfo>(
- wgt::application_widget_keys::kTizenApplicationKey);
- auto wgt_info =
- GetManifestDataForKey<const wgt::parse::WidgetInfo>(
- wgt::application_widget_keys::kTizenWidgetKey);
+ auto info = GetManifestDataForKey<const wgt::parse::TizenApplicationInfo>(
+ app_keys::kTizenApplicationKey);
+ auto wgt_info = GetManifestDataForKey<const wgt::parse::WidgetInfo>(
+ app_keys::kTizenWidgetKey);
+ auto addon_info = GetManifestDataForKey<const wgt::parse::AddonInfo>(
+ app_keys::kTizenAddonKey);
std::string name;
const auto& name_set = wgt_info->name_set();
short_name = short_name_set.begin()->second;
const std::string& package_version = wgt_info->version();
- const std::string& required_api_version = info->required_version();
+ const std::string& required_api_version = addon_info.get() ?
+ addon_info->required_version() : info->required_version();
manifest_x* manifest =
static_cast<manifest_x*>(calloc(1, sizeof(manifest_x)));
backend_data->settings.set(*settings_info);
LOG(DEBUG) << " Read data -[ ";
- LOG(DEBUG) << "App id: " << info->id();
- LOG(DEBUG) << " package = " << info->package();
- LOG(DEBUG) << " id = " << info->id();
+ if (info.get())
+ LOG(DEBUG) << "App id: " << info->id();
+ if (info.get())
+ LOG(DEBUG) << " package = " << info->package();
+ else if (addon_info.get())
+ LOG(DEBUG) << " package = " << addon_info->package();
+ if (info.get())
+ LOG(DEBUG) << " id = " << info->id();
LOG(DEBUG) << " name = " << name;
LOG(DEBUG) << " short_name = " << short_name;
LOG(DEBUG) << " aplication version = " << package_version;
- LOG(DEBUG) << " api_version = " << info->required_version();
- LOG(DEBUG) << " launch_mode = " << info->launch_mode();
+ if (info.get())
+ LOG(DEBUG) << " api_version = " << info->required_version();
+ else if (addon_info.get())
+ LOG(DEBUG) << " api_version = " << addon_info->required_version();
+ if (info.get())
+ LOG(DEBUG) << " launch_mode = " << info->launch_mode();
LOG(DEBUG) << " privileges -[";
for (const auto& p : permissions) {
LOG(DEBUG) << " " << p;
#include <manifest_parser/utils/logging.h>
#include <wgt_manifest_handlers/application_manifest_constants.h>
#include <wgt_manifest_handlers/tizen_application_handler.h>
+#include <wgt_manifest_handlers/addon_handler.h>
#include <wgt_manifest_handlers/widget_handler.h>
#include <tzplatform_config.h>
return {};
std::vector<std::shared_ptr<parser::ManifestHandler>> handlers = {
std::make_shared<wgt::parse::WidgetHandler>(),
- std::make_shared<wgt::parse::TizenApplicationHandler>()
+ std::make_shared<wgt::parse::TizenApplicationHandler>(),
+ std::make_shared<wgt::parse::AddonHandler>()
};
std::unique_ptr<parser::ManifestHandlerRegistry> registry(
new parser::ManifestHandlerRegistry(handlers));
auto info = std::static_pointer_cast<const wgt::parse::TizenApplicationInfo>(
parser->GetManifestData(
wgt::application_widget_keys::kTizenApplicationKey));
- if (!info) {
+
+ auto info_addon = std::static_pointer_cast<const wgt::parse::AddonInfo>(
+ parser->GetManifestData(
+ wgt::application_widget_keys::kTizenAddonKey));
+
+ if (!info && !info_addon) {
ci::RemoveAll(tmp_path);
return {};
}
- std::string pkg_id = info->package();
+ std::string pkg_id = !info ? info_addon->package() : info->package();
ci::RemoveAll(tmp_path);
return pkg_id;