From: Hwankyu Jhun Date: Thu, 30 Nov 2023 04:29:51 +0000 (+0900) Subject: Fix a bug about restarting apps X-Git-Tag: accepted/tizen/7.0/unified/20231130.182427~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89a9a95720ae656ada43e21660e280c5ad40a24c;p=platform%2Fcore%2Fappfw%2Famd.git Fix a bug about restarting apps After updating the package, the application was not restarted by amd. Because, if the application has the on-boot="true" option in the tizen-manifest.xm, amd does not check whether the application is able to restart or not. If the api-version is greater than 7, amd must check whether the application should be restarted or not. This patch checks the api version to restart apps. Change-Id: Ibfe8245782cd5b0d5b6dc3bd7eda3363379c85b7 Signed-off-by: Hwankyu Jhun --- diff --git a/src/lib/app_info/app_info_manager.cc b/src/lib/app_info/app_info_manager.cc index 1ff9e97b..4561e8cf 100644 --- a/src/lib/app_info/app_info_manager.cc +++ b/src/lib/app_info/app_info_manager.cc @@ -834,7 +834,8 @@ int AppInfoManager::PkgmgrEventUpdateHandler(const pkgmgrinfo_appinfo_h handle, return -1; } - if (app_info->GetOnboot() == "false") + if (app_info->GetOnboot() == "false" || + strverscmp(app_info->GetApiVersion().c_str(), "7") >= 0) _restart_manager_restart_app(chunk->GetUid(), appid); return 0; diff --git a/src/lib/boot_sequencer/boot_sequencer.cc b/src/lib/boot_sequencer/boot_sequencer.cc index 3ea7f173..9901b7cd 100644 --- a/src/lib/boot_sequencer/boot_sequencer.cc +++ b/src/lib/boot_sequencer/boot_sequencer.cc @@ -52,7 +52,6 @@ constexpr const char TAG_INFO_PATH_EXISTS[] = "INFO:PATH_EXISTS"; constexpr const char TAG_INFO_TIMEOUT[] = "INFO:TIMEOUT"; constexpr const char REQUIRED_API_VERSION[] = "7"; -constexpr const char REQUIRED_DOTNET_API_VERSION[] = "10"; } // namespace @@ -540,13 +539,7 @@ void BootSequencer::StartLegacyOnbootApp(const char* appid, uid_t uid) { return; _D("%s : %u", appid, uid); - const char* required_api_version; - if (app_info->GetApptype().find("dotnet") != std::string::npos) - required_api_version = REQUIRED_DOTNET_API_VERSION; - else - required_api_version = REQUIRED_API_VERSION; - - if (strverscmp(required_api_version, app_info->GetApiVersion().c_str()) > 0) { + if (strverscmp(REQUIRED_API_VERSION, app_info->GetApiVersion().c_str()) > 0) { int ret = _launch_start_onboot_app_local(uid, appid, app_info.get()); _W("%s : %u : %d", appid, uid, ret); }