From dead49460ddb047cc05bce895c5e43d09c5626f6 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Tue, 9 Mar 2021 21:17:37 -0800 Subject: [PATCH] Support legacy web service apps This creates symlink to wrt-service only if service type is not defined to support legacy web service apps. Change-Id: I0c7214770aa50fae6236597b8f5a3b11e8a54f07 Signed-off-by: Youngsoo Choi --- src/wgt/step/configuration/step_parse.cc | 10 +++++----- src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index 3b11daa..c7d17e6 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -344,7 +344,7 @@ bool StepParse::AllServiceAppGlobal() { } bool all_service_app_global = true; for (const auto& service_info : service_list->services) { - if (service_info.type() != "global") { + if (service_info.type() == "ui") { all_service_app_global = false; break; } @@ -991,6 +991,10 @@ common_installer::Step::Status StepParse::process() { WgtBackendData* backend_data = static_cast(context_->backend_data.get()); + auto service_list = GetManifestDataForKey( + app_keys::kTizenServiceKey); + if (service_list) + backend_data->service_list.set(*service_list); if (check_start_file_) { if (!ui_app_not_exists_ && !parser_->CheckValidStartFile()) { @@ -1007,12 +1011,8 @@ common_installer::Step::Status StepParse::process() { // making backup of content data and services content data auto content_info = GetManifestDataForKey( app_keys::kTizenContentKey); - auto service_list = GetManifestDataForKey( - app_keys::kTizenServiceKey); if (content_info) backend_data->content.set(*content_info); - if (service_list) - backend_data->service_list.set(*service_list); } context_->pkgid.set(manifest->package); diff --git a/src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc b/src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc index c6ea4fd..3b9f132 100644 --- a/src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc +++ b/src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -17,12 +18,15 @@ #include #include +#include "wgt/utils/wgt_backend_data.h" + namespace bf = boost::filesystem; namespace bs = boost::system; namespace { -const char kWrtServiceBinaryPath[] = "/usr/bin/wrt-service-launcher"; +const char kWrtServiceBinaryPath[] = "/usr/bin/wrt-service"; +const char kWrtServiceLauncherBinaryPath[] = "/usr/bin/wrt-service-launcher"; const char kWebWidgetRuntimeBinaryPath[] = "/usr/bin/web-widget-runtime"; const char kWRTPath[] = "/usr/bin/wrt"; @@ -32,6 +36,13 @@ namespace wgt { namespace filesystem { bool StepCreateWgtSymbolicLink::CreateSymlinksForApps() { + std::unordered_map service_app_type; + WgtBackendData* backend_data = + static_cast(context_->backend_data.get()); + for (auto& service_info : backend_data->service_list.get().services) { + service_app_type[service_info.id()] = service_info.type(); + } + boost::system::error_code error; for (application_x* app : GListRange(context_->manifest_data.get()->application)) { @@ -52,6 +63,8 @@ bool StepCreateWgtSymbolicLink::CreateSymlinksForApps() { bf::create_symlink(bf::path(kWRTPath), exec_path, error); } else if (strcmp(app->component_type, "widgetapp") == 0) { bf::create_symlink(kWebWidgetRuntimeBinaryPath, exec_path, error); + } else if (!service_app_type[app->appid].empty()) { + bf::create_symlink(kWrtServiceLauncherBinaryPath, exec_path, error); } else { bf::create_symlink(kWrtServiceBinaryPath, exec_path, error); } -- 2.7.4