diff options
author | Sangyoon Jang <jeremy.jang@samsung.com> | 2024-04-02 16:30:05 +0900 |
---|---|---|
committer | Sangyoon Jang <jeremy.jang@samsung.com> | 2024-04-03 08:42:06 +0900 |
commit | a5e4ef9c5cb617aef8dd3a668800da1b2025ac07 (patch) | |
tree | 735c7de1fff0ad56dd234211d238607b4e3e1f46 | |
parent | 1a3ee7333fea8d2fb0bc5918c3b39640faa4a676 (diff) | |
download | app-installers-a5e4ef9c5cb617aef8dd3a668800da1b2025ac07.tar.gz app-installers-a5e4ef9c5cb617aef8dd3a668800da1b2025ac07.tar.bz2 app-installers-a5e4ef9c5cb617aef8dd3a668800da1b2025ac07.zip |
Parse robot-application
Change-Id: If15559eb6d5c7eefb9a0bc546ca812fa1dfb3a9a
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
-rw-r--r-- | src/common/step/configuration/step_parse_manifest.cc | 75 | ||||
-rw-r--r-- | src/common/step/configuration/step_parse_manifest.h | 1 |
2 files changed, 76 insertions, 0 deletions
diff --git a/src/common/step/configuration/step_parse_manifest.cc b/src/common/step/configuration/step_parse_manifest.cc index e2ad305f..70e1a862 100644 --- a/src/common/step/configuration/step_parse_manifest.cc +++ b/src/common/step/configuration/step_parse_manifest.cc @@ -19,6 +19,7 @@ #include <tpk_manifest_handlers/privileges_handler.h> #include <tpk_manifest_handlers/profile_handler.h> #include <tpk_manifest_handlers/provides_appdefined_privileges_handler.h> +#include <tpk_manifest_handlers/robot_application_handler.h> #include <tpk_manifest_handlers/service_application_handler.h> #include <tpk_manifest_handlers/shortcut_handler.h> #include <tpk_manifest_handlers/trust_anchor_handler.h> @@ -1293,6 +1294,78 @@ bool StepParseManifest::FillComponentBasedApplicationInfo( return true; } +bool StepParseManifest::FillRobotApplicationInfo( + manifest_x* manifest) { + std::shared_ptr<const tpk::parse::RobotApplicationInfoList> + robot_application_list = std::static_pointer_cast< + const tpk::parse::RobotApplicationInfoList>( + parser_->GetManifestData( + app_keys::kRobotApplicationKey)); + if (!robot_application_list) + return true; + + for (const auto& application : robot_application_list->items) { + int package_support_mode_val = atoi(manifest->support_mode); + int app_support_mode_val = package_support_mode_val | + GetSupportModeVal(application.app_info.support_mode()); + + application_x* app = + static_cast<application_x*>(calloc(1, sizeof(application_x))); + if (!app) { + LOG(ERROR) << "Out of memory"; + return false; + } + + app->appid = strdup(application.app_info.appid().c_str()); + app->multiple = strdup("false"); + app->nodisplay = strdup("false"); + app->support_mode = strdup((std::to_string(app_support_mode_val)).c_str()); + app->taskmanage = strdup("false"); + if (!application.app_info.type().empty()) + app->type = strdup(application.app_info.type().c_str()); + else + app->type = strdup("robotapp"); + app->indicatordisplay = strdup("false"); + app->component_type = strdup("robotapp"); + app->hwacceleration = strdup("default"); + app->onboot = strdup("false"); + app->autorestart = strdup("false"); + app->mainapp = strdup(application.app_info.mainapp().c_str()); + app->screenreader = strdup("use-system-setting"); + app->recentimage = strdup("false"); + app->launchcondition = strdup("false"); + app->guestmode_visibility = strdup("true"); + app->permission_type = strdup("normal"); + app->support_ambient = strdup("false"); + app->effectimage_type = strdup("image"); + app->submode = strdup("false"); + app->process_pool = strdup("false"); + app->package = strdup(manifest->package); + app->support_disable = strdup(manifest->support_disable); + app->launch_mode = strdup("single"); + if (!application.app_info.api_version().empty()) + app->api_version = strdup(application.app_info.api_version().c_str()); + else + app->api_version = strdup(manifest->api_version); + manifest->application = g_list_append(manifest->application, app); + if (fs::path(application.app_info.exec().c_str()).is_absolute()) { + app->exec = strdup(application.app_info.exec().c_str()); + } else { + app->exec = strdup((context_->root_application_path.get() + / manifest->package / "bin" + / application.app_info.exec()).c_str()); + } + if (!FillLabel(app, application.label)) + return false; + if (!FillMetadata(app, application.meta_data)) + return false; + if (!FillResControl(app, application.res_controls)) + return false; + } + + return true; +} + bool StepParseManifest::FillManifestX(manifest_x* manifest) { if (!FillPackageInfo(manifest)) return false; @@ -1308,6 +1381,8 @@ bool StepParseManifest::FillManifestX(manifest_x* manifest) { return false; if (!FillComponentBasedApplicationInfo(manifest)) return false; + if (!FillRobotApplicationInfo(manifest)) + return false; if (!FillPrivileges(manifest)) return false; if (!FillProvidesAppDefinedPrivileges(manifest)) diff --git a/src/common/step/configuration/step_parse_manifest.h b/src/common/step/configuration/step_parse_manifest.h index ba09c759..436e44d8 100644 --- a/src/common/step/configuration/step_parse_manifest.h +++ b/src/common/step/configuration/step_parse_manifest.h @@ -73,6 +73,7 @@ class StepParseManifest : public common_installer::Step { bool FillTrustAnchorInfo(manifest_x* manifest); bool FillDependencyInfo(manifest_x* manifest); bool FillComponentBasedApplicationInfo(manifest_x* manifest); + bool FillRobotApplicationInfo(manifest_x* manifest); bool FillLightUserInfo(manifest_x* manifest); int GetSupportModeVal(std::string support_mode); bool CheckFeatures(); |