From: Sangyoon Jang Date: Tue, 2 Apr 2024 07:30:05 +0000 (+0900) Subject: Parse robot-application X-Git-Tag: accepted/tizen/unified/20240404.164446~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fappfw%2Fapp-installers.git;a=commitdiff_plain;h=a5e4ef9c5cb617aef8dd3a668800da1b2025ac07 Parse robot-application Change-Id: If15559eb6d5c7eefb9a0bc546ca812fa1dfb3a9a Signed-off-by: Sangyoon Jang --- diff --git a/src/common/step/configuration/step_parse_manifest.cc b/src/common/step/configuration/step_parse_manifest.cc index e2ad305..70e1a86 100644 --- a/src/common/step/configuration/step_parse_manifest.cc +++ b/src/common/step/configuration/step_parse_manifest.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1293,6 +1294,78 @@ bool StepParseManifest::FillComponentBasedApplicationInfo( return true; } +bool StepParseManifest::FillRobotApplicationInfo( + manifest_x* manifest) { + std::shared_ptr + 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(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 ba09c75..436e44d 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();