diff --git a/foundations/ability/log/include/update_log.h b/foundations/ability/log/include/update_log.h index 1bfb683aa2c20e35e21c34033b2b0112595dda18..3ca7e14bd0d0a0c0905054942f8121180c854a12 100644 --- a/foundations/ability/log/include/update_log.h +++ b/foundations/ability/log/include/update_log.h @@ -38,10 +38,10 @@ enum UpdaterModuleTags { }; static constexpr OHOS::HiviewDFX::HiLogLabel UPDATE_LABEL[UPDATE_MODULE_MAX] = { - { LOG_CORE, UPDATER_SA_DOMAIN_ID, "UPDATE_SA" }, - { LOG_CORE, UPDATER_SA_DOMAIN_ID, "UPDATE_KITS" }, - { LOG_CORE, UPDATER_SA_DOMAIN_ID, "UPDATE_FIRMWARE" }, - { LOG_CORE, UPDATER_SA_DOMAIN_ID, "UPDATER_MODULE_MGR" } + { LOG_CORE, UPDATER_SA_DOMAIN_ID, "UPDATE_SERVICE_SA" }, + { LOG_CORE, UPDATER_SA_DOMAIN_ID, "UPDATE_SERVICE_KITS" }, + { LOG_CORE, UPDATER_SA_DOMAIN_ID, "UPDATE_SERVICE_FIRMWARE" }, + { LOG_CORE, UPDATER_SA_DOMAIN_ID, "UPDATE_SERVICE_MODULE_MGR" } }; enum class UpdateLogLevel { diff --git a/foundations/ability/log/src/update_log.cpp b/foundations/ability/log/src/update_log.cpp index 74544bb016f28ede0d6f4c97878d7a6892ca4d1a..1da0bca77045e34a972fbc6099ad360dd3c3697c 100644 --- a/foundations/ability/log/src/update_log.cpp +++ b/foundations/ability/log/src/update_log.cpp @@ -82,9 +82,11 @@ void UpdateLog::PrintSingleLine(const uint32_t subModuleTag, const UpdateLogCont case UpdateLogLevel::UPDATE_DEBUG: LONG_PRINT_HILOG(LOG_DEBUG, subModuleTag, logContent.log, UpdateLog::GetBriefFileName(logContent.fileName).c_str(), logContent.line, logContent.args.c_str()); + break; case UpdateLogLevel::UPDATE_INFO: LONG_PRINT_HILOG(LOG_INFO, subModuleTag, logContent.log, UpdateLog::GetBriefFileName(logContent.fileName).c_str(), logContent.line, logContent.args.c_str()); + break; case UpdateLogLevel::UPDATE_ERROR: LONG_PRINT_HILOG(LOG_ERROR, subModuleTag, logContent.log, UpdateLog::GetBriefFileName(logContent.fileName).c_str(), logContent.line, logContent.args.c_str()); diff --git a/foundations/ability/sa_loader/include/base_service_kits_impl.h b/foundations/ability/sa_loader/include/base_service_kits_impl.h index e1a433b06021065c0db52853fac9bf94ca0da5b9..c3e5ae021f59dbfab54bf0338fa67d12cf2f83b1 100644 --- a/foundations/ability/sa_loader/include/base_service_kits_impl.h +++ b/foundations/ability/sa_loader/include/base_service_kits_impl.h @@ -18,9 +18,6 @@ #include -#ifndef ABILITY_RUNTIME_INNER_ENABLE -#include "ability_manager_proxy.h" -#endif #include "iremote_object.h" #include "common_death_recipient.h" @@ -76,7 +73,6 @@ template BaseServiceKitsImpl::~BaseServiceKitsImpl() template sptr BaseServiceKitsImpl::GetService() { - ENGINE_LOGI("GetService entry"); std::lock_guard lock(remoteServerLock_); if (remoteServer_ != nullptr) { return remoteServer_; diff --git a/foundations/ability/sa_loader/sa_loader.gni b/foundations/ability/sa_loader/sa_loader.gni index 02290adf6364eaf777cad25291d6bd8159d999d6..5abeec5cbcfd8de1309ba764afd602ce95c8336b 100644 --- a/foundations/ability/sa_loader/sa_loader.gni +++ b/foundations/ability/sa_loader/sa_loader.gni @@ -20,7 +20,7 @@ sa_loader_external_deps = [ "samgr:samgr_proxy", ] if (ability_ability_runtime_enable) { - sa_loader_external_deps += [ "ability_runtime:ability_manager" ] + sa_loader_external_deps += [ "ability_runtime:extension_manager" ] } sa_loader_deps = [] diff --git a/frameworks/js/napi/session/include/base_promise_session.h b/frameworks/js/napi/session/include/base_promise_session.h index 6ed63e635de28064908fb5c8b10dbfe5040e193c..956d624f1c127fbd7f20be3945ddb6304d60dc5f 100644 --- a/frameworks/js/napi/session/include/base_promise_session.h +++ b/frameworks/js/napi/session/include/base_promise_session.h @@ -31,7 +31,6 @@ public: napi_value StartWork(napi_env env, size_t startIndex, const napi_value *args) override { - ENGINE_LOGI("BasePromiseSession::StartWork"); PARAM_CHECK_NAPI_CALL(env, args != nullptr, return nullptr, "Invalid para"); napi_value workName = CreateWorkerName(env); PARAM_CHECK_NAPI_CALL(env, workName != nullptr, return nullptr, "Failed to worker name"); @@ -53,7 +52,9 @@ public: void NotifyJS(napi_env env, napi_value thisVar, const RESULT &result) { int32_t errorNum = static_cast(result.businessError.errorNum); - ENGINE_LOGI("BasePromiseSession NotifyJS errorNum:%{public}d", errorNum); + if (errorNum != 0) { + ENGINE_LOGI("BasePromiseSession NotifyJS errorNum:%{public}d", errorNum); + } // Get the return result. napi_value processResult = nullptr; diff --git a/frameworks/js/napi/session/src/napi_session.cpp b/frameworks/js/napi/session/src/napi_session.cpp index 99c006fbf30d030c8b7a1ce3d39390577f7d944d..03d36c8ff1ca5635ec6055a789746b33cd92b6f6 100644 --- a/frameworks/js/napi/session/src/napi_session.cpp +++ b/frameworks/js/napi/session/src/napi_session.cpp @@ -56,7 +56,9 @@ void NapiSession::ExecuteWork(napi_env env) } else { workResult_ = doWorker_(context_); } - ENGINE_LOGI("UpdateSession::ExecuteWork workResult : %{public}d", workResult_); + if (workResult_ != 0) { + ENGINE_LOGI("UpdateSession::ExecuteWork workResult : %{public}d", workResult_); + } if (sessionParams_.isAsyncCompleteWork && IsWorkExecuteSuccess()) { // 异步搜包完成,需要把businessError设置进来或者超时,才能结束等待 std::unique_lock lock(conditionVariableMutex_); diff --git a/frameworks/js/napi/update/BUILD.gn b/frameworks/js/napi/update/BUILD.gn index b2bc922aa690b1043ce79c3c5773d7a8b5c10f86..a9624f520ea5960de4f82810285701356d4c448d 100644 --- a/frameworks/js/napi/update/BUILD.gn +++ b/frameworks/js/napi/update/BUILD.gn @@ -45,7 +45,6 @@ ohos_shared_library("$updateengine_client_library_name") { external_deps = [ "c_utils:utils", # sptr - "eventhandler:libeventhandler", "hilog:libhilog", ] diff --git a/frameworks/js/napi/update/include/session_manager.h b/frameworks/js/napi/update/include/session_manager.h index 585abe572a2fac6b7908d3abdd927b195cb10777..38bf5dc06a3daf8a99df6a8a2c60c8a6bc05b6ec 100644 --- a/frameworks/js/napi/update/include/session_manager.h +++ b/frameworks/js/napi/update/include/session_manager.h @@ -25,7 +25,6 @@ #include "base_session.h" #include "event_classify_info.h" -#include "event_handler.h" #include "event_info.h" namespace OHOS::UpdateEngine { @@ -55,7 +54,6 @@ private: napi_ref thisReference_ {}; std::map> sessions_; std::recursive_mutex sessionMutex_; - std::shared_ptr handler_; }; } // namespace OHOS::UpdateEngine #endif // UPDATE_SESSION_MGR_H \ No newline at end of file diff --git a/frameworks/js/napi/update/src/local_updater.cpp b/frameworks/js/napi/update/src/local_updater.cpp index 1621450197aa29fbe655fcdfea7fd85d0962ae7c..b52c026b27c664d1a4473ef7dd2b2b651754c7b2 100644 --- a/frameworks/js/napi/update/src/local_updater.cpp +++ b/frameworks/js/napi/update/src/local_updater.cpp @@ -127,14 +127,21 @@ napi_value LocalUpdater::ApplyNewVersion(napi_env env, napi_callback_info info) return StartParamErrorSession(env, info, CALLBACK_POSITION_TWO); } + std::vector packageNames; + for (const UpgradeFile &upgradeFile : upgradeFiles) { + packageNames.emplace_back(upgradeFile.filePath); + } + SessionParams sessionParams(SessionType::SESSION_APPLY_NEW_VERSION, CALLBACK_POSITION_TWO, true); napi_value retValue = StartSession(env, info, sessionParams, - [upgradeFiles](void *context) -> int { - ENGINE_LOGI("ApplyNewVersion %s", upgradeFiles[0].filePath.c_str()); + [packageNames](void *context) -> int { + for (const std::string &packageName : packageNames) { + ENGINE_LOGI("ApplyNewVersion %{public}s", packageName.c_str()); + } BusinessError *businessError = reinterpret_cast(context); UpgradeInfo upgradeInfo; upgradeInfo.upgradeApp = LOCAL_UPGRADE_INFO; - return UpdateServiceKits::GetInstance().ApplyNewVersion(upgradeInfo, MISC_FILE, upgradeFiles[0].filePath, + return UpdateServiceKits::GetInstance().ApplyNewVersion(upgradeInfo, MISC_FILE, packageNames, *businessError); }); PARAM_CHECK(retValue != nullptr, return nullptr, "Failed to ApplyNewVersion"); diff --git a/frameworks/js/napi/update/src/session_manager.cpp b/frameworks/js/napi/update/src/session_manager.cpp index 58ded00475d7eab4cdf61c8ef855d1564d45fe4d..fa0cd123ceeb09cb4ba37f331f35e710e8841d0f 100644 --- a/frameworks/js/napi/update/src/session_manager.cpp +++ b/frameworks/js/napi/update/src/session_manager.cpp @@ -29,7 +29,6 @@ namespace OHOS::UpdateEngine { SessionManager::SessionManager(napi_env env, napi_ref thisReference) : env_(env), thisReference_(thisReference) { ENGINE_LOGI("SessionManager constructor"); - handler_ = std::make_shared(AppExecFwk::EventRunner::GetMainEventRunner()); } SessionManager::~SessionManager() @@ -50,7 +49,6 @@ void SessionManager::AddSession(std::shared_ptr session) void SessionManager::RemoveSession(uint32_t sessionId) { - ENGINE_LOGI("RemoveSession sess"); std::lock_guard guard(sessionMutex_); sessions_.erase(sessionId); } @@ -229,11 +227,29 @@ void SessionManager::PublishToJS(const EventClassifyInfo &eventClassifyInfo, con void SessionManager::Emit(const EventClassifyInfo &eventClassifyInfo, const EventInfo &eventInfo) { ENGINE_LOGI("SessionManager::Emit 0x%{public}x", CAST_INT(eventClassifyInfo.eventClassify)); - auto task = [eventClassifyInfo, eventInfo, this]() { PublishToJS(eventClassifyInfo, eventInfo); }; - if (handler_ == nullptr) { - ENGINE_LOGI("handler_ is nullptr"); - return; - } - handler_->PostTask(task); + uv_loop_s *loop = nullptr; + napi_get_uv_event_loop(env_, &loop); + PARAM_CHECK(loop != nullptr, return, "get event loop failed."); + + using UvWorkData = std::tuple; + UvWorkData *data = new (std::nothrow) std::tuple(this, eventClassifyInfo, eventInfo); + PARAM_CHECK(data != nullptr, return, "alloc data failed."); + + uv_work_t *work = new (std::nothrow) uv_work_t; + PARAM_CHECK(work != nullptr, delete data; return, "alloc work failed."); + + work->data = static_cast(data); + uv_queue_work_with_qos( + loop, + work, + [](uv_work_t *work) { ENGINE_LOGI("print job info"); }, + [](uv_work_t *work, int status) { + UvWorkData *data = static_cast(work->data); + auto &[mgr, eventClassifyInfo, eventInfo] = *data; + mgr->PublishToJS(eventClassifyInfo, eventInfo); + delete data; + delete work; + }, + uv_qos_default); } } // namespace OHOS::UpdateEngine \ No newline at end of file diff --git a/frameworks/js/napi/update/src/update_session.cpp b/frameworks/js/napi/update/src/update_session.cpp index 59da7c8c8546a55d2bb86e3db300387614698185..abc6f49d875b5684efdeb05273dc954943c0c286 100644 --- a/frameworks/js/napi/update/src/update_session.cpp +++ b/frameworks/js/napi/update/src/update_session.cpp @@ -40,7 +40,6 @@ std::string BaseUpdateSession::GetFunctionName() void UpdatePromiseSession::CompleteWork(napi_env env, napi_status status) { - ENGINE_LOGI("UpdatePromiseSession::CompleteWork status: %d", static_cast(status)); UpdateResult result; GetUpdateResult(result); NotifyJS(env, NULL, result); diff --git a/interfaces/inner_api/engine/BUILD.gn b/interfaces/inner_api/engine/BUILD.gn index 4d84e3482b5a0d795e5bc9c695eafc14770e43f8..9dcd2bb1dc12069a9b5ab694a2bffcb5569cf05f 100644 --- a/interfaces/inner_api/engine/BUILD.gn +++ b/interfaces/inner_api/engine/BUILD.gn @@ -79,7 +79,7 @@ ohos_shared_library("$updateengine_inner_library_name") { external_deps += feature_external_deps if (ability_ability_runtime_enable) { - external_deps += [ "ability_runtime:ability_manager" ] + external_deps += [ "ability_runtime:extension_manager" ] } innerapi_tags = [ "platformsdk" ] part_name = "$updateengine_part_name" diff --git a/interfaces/inner_api/engine/include/update_service_kits_impl.h b/interfaces/inner_api/engine/include/update_service_kits_impl.h index 9640797732a16696fc5a95b79b8c1cadfa3ae499..2409f2d014786ba3d7516581e9e7dfca29807189 100644 --- a/interfaces/inner_api/engine/include/update_service_kits_impl.h +++ b/interfaces/inner_api/engine/include/update_service_kits_impl.h @@ -80,8 +80,8 @@ public: int32_t FactoryReset(BusinessError &businessError) final; - int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, const std::string &packageName, - BusinessError &businessError) final; + int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, + const std::vector &packageNames, BusinessError &businessError) final; int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) final; diff --git a/interfaces/inner_api/engine/include/update_service_proxy.h b/interfaces/inner_api/engine/include/update_service_proxy.h index f77464e8cd2f4407654fcc9ddf1839e44643d4ed..a0655af844c6aed1aa46d7b5a5c0d3f32ac79f99 100644 --- a/interfaces/inner_api/engine/include/update_service_proxy.h +++ b/interfaces/inner_api/engine/include/update_service_proxy.h @@ -72,8 +72,8 @@ public: int32_t FactoryReset(BusinessError &businessError) override; - int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, const std::string &packageName, - BusinessError &businessError) override; + int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, + const std::vector &packageNames, BusinessError &businessError) override; int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) override; diff --git a/interfaces/inner_api/engine/src/update_service_kits_impl.cpp b/interfaces/inner_api/engine/src/update_service_kits_impl.cpp index dc9cce5d9f5bf257b77321838887a85a9cdaa1ef..ada4fe92b9db027f854829e0e3d87b43567cf66e 100644 --- a/interfaces/inner_api/engine/src/update_service_kits_impl.cpp +++ b/interfaces/inner_api/engine/src/update_service_kits_impl.cpp @@ -242,12 +242,12 @@ int32_t UpdateServiceKitsImpl::FactoryReset(BusinessError &businessError) } int32_t UpdateServiceKitsImpl::ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, - const std::string &packageName, BusinessError &businessError) + const std::vector &packageNames, BusinessError &businessError) { ENGINE_LOGI("UpdateServiceKitsImpl::ApplyNewVersion"); auto updateService = GetService(); RETURN_FAIL_WHEN_SERVICE_NULL(updateService); - int32_t ret = updateService->ApplyNewVersion(info, miscFile, packageName, businessError); + int32_t ret = updateService->ApplyNewVersion(info, miscFile, packageNames, businessError); ENGINE_CHECK((ret) == INT_CALL_SUCCESS, ResetRemoteService(), "ApplyNewVersion ipc error"); return ret; } diff --git a/interfaces/inner_api/engine/src/update_service_proxy.cpp b/interfaces/inner_api/engine/src/update_service_proxy.cpp index 4a0442388e7b3b35f7cdcab1e0ca0ad948ca7c0e..cc2f65f9f62bcaad6f7a658b4f394a1bbf0b805c 100644 --- a/interfaces/inner_api/engine/src/update_service_proxy.cpp +++ b/interfaces/inner_api/engine/src/update_service_proxy.cpp @@ -471,7 +471,7 @@ int32_t UpdateServiceProxy::FactoryReset(BusinessError &businessError) } int32_t UpdateServiceProxy::ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, - const std::string &packageName, BusinessError &businessError) + const std::vector &packageNames, BusinessError &businessError) { ENGINE_LOGI("UpdateServiceProxy::ApplyNewVersion"); auto remote = Remote(); @@ -481,7 +481,10 @@ int32_t UpdateServiceProxy::ApplyNewVersion(const UpgradeInfo &info, const std:: RETURN_WHEN_TOKEN_WRITE_FAIL(data); MessageParcelHelper::WriteUpgradeInfo(data, info); data.WriteString16(Str8ToStr16(miscFile)); - data.WriteString16(Str8ToStr16(packageName)); + data.WriteInt32(static_cast(packageNames.size())); + for (size_t i = 0; i < packageNames.size(); i++) { + data.WriteString16(Str8ToStr16(packageNames[i])); + } MessageParcel reply; MessageOption option; diff --git a/interfaces/inner_api/feature/update/api/local_updater/iservice_local_updater.h b/interfaces/inner_api/feature/update/api/local_updater/iservice_local_updater.h index 1d98f6861c13f3bf1c7e8f9697a987995d1c13c1..ed2b03c77332989c80edf29b8afd9d6146c5056e 100644 --- a/interfaces/inner_api/feature/update/api/local_updater/iservice_local_updater.h +++ b/interfaces/inner_api/feature/update/api/local_updater/iservice_local_updater.h @@ -27,7 +27,7 @@ public: virtual ~IServiceLocalUpdater() = default; virtual int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, - const std::string &packageName, BusinessError &businessError) = 0; + const std::vector &packageNames, BusinessError &businessError) = 0; virtual int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) = 0; diff --git a/interfaces/inner_api/feature/update/model/event/event_classify.h b/interfaces/inner_api/feature/update/model/event/event_classify.h index 4b70e86c8093bf9839d1da7142393658fcbb7ba4..58f6dc40d654698190e65b2d1508ec6a936b0438 100644 --- a/interfaces/inner_api/feature/update/model/event/event_classify.h +++ b/interfaces/inner_api/feature/update/model/event/event_classify.h @@ -22,8 +22,10 @@ namespace OHOS::UpdateEngine { enum class EventClassify { TASK = 0x01000000, SYSTEM = 0x02000000, + COMMAND = 0x04000000, }; -const std::list g_eventClassifyList = { EventClassify::TASK, EventClassify::SYSTEM }; +const std::list g_eventClassifyList = { EventClassify::TASK, EventClassify::SYSTEM, + EventClassify::COMMAND }; } // namespace OHOS::UpdateEngine #endif // UPDATE_SERVICE_EVENT_CLASSIFY_H diff --git a/interfaces/inner_api/feature/update/model/event/event_id.h b/interfaces/inner_api/feature/update/model/event/event_id.h index fbbb908f1fc893e2a0deaa961fc744dbb0912346..e7675d40858964b48c338765ae2bb2b6a645106d 100644 --- a/interfaces/inner_api/feature/update/model/event/event_id.h +++ b/interfaces/inner_api/feature/update/model/event/event_id.h @@ -41,7 +41,6 @@ enum class EventId { EVENT_AUTH_START, EVENT_AUTH_SUCCESS, EVENT_DOWNLOAD_CANCEL, - EVENT_INITIALIZE, EVENT_TASK_CHANGE, EVENT_VERSION_INFO_CHANGE, EVENT_TRANSFER_WAIT, @@ -49,8 +48,12 @@ enum class EventId { EVENT_TRANSFERING, EVENT_TRANSFER_SUCCESS, EVENT_TRANSFER_FAIL, + SYSTEM_BASE = CAST_UINT(EventClassify::SYSTEM), SYSTEM_BOOT_COMPLETE, + + COMMAND_BASE = CAST_UINT(EventClassify::COMMAND), + EVENT_INITIALIZE, }; } // namespace OHOS::UpdateEngine #endif // UPDATE_SERVICE_EVENT_ID_H diff --git a/interfaces/inner_api/feature/update/model/subscribe/subscribe_info.h b/interfaces/inner_api/feature/update/model/subscribe/subscribe_info.h index 24b1dd035fdbb9a57f47d7ab1211dc089eb4616a..7f49f58c88047664a35f4234a94148ff69fcb8b1 100644 --- a/interfaces/inner_api/feature/update/model/subscribe/subscribe_info.h +++ b/interfaces/inner_api/feature/update/model/subscribe/subscribe_info.h @@ -23,11 +23,13 @@ #include "update_device_type.h" namespace OHOS::UpdateEngine { -const std::string OUC_PACKAGE_NAME = "com.ohos.updateapp"; -const std::string OUC_SERVICE_EXT_ABILITY_NAME = "ServiceExtAbility"; +const std::string UPDATE_APP_PACKAGE_NAME = "com.ohos.updateapp"; +const std::string UPDATE_APP_SERVICE_EXT_ABILITY_NAME = "ServiceExtAbility"; +constexpr int32_t UPDATE_APP_TIMEOUT = 15; +constexpr int32_t UPDATE_APP_CONNECT_TIMEOUT = 5; struct SubscribeInfo : public BaseJsonStruct { - std::string upgradeApp = OUC_PACKAGE_NAME; + std::string upgradeApp = UPDATE_APP_PACKAGE_NAME; BusinessType businessType = {}; std::string abilityName; std::string subscriberDevId; diff --git a/interfaces/inner_api/feature/update/model/task/task_body_member_mask.h b/interfaces/inner_api/feature/update/model/task/task_body_member_mask.h index 54c22b85da942e17ca0516af217022a7a8d9c9e9..f8c502fe3f6e0a9df921d8ae87c19e9b8eb5a8c3 100644 --- a/interfaces/inner_api/feature/update/model/task/task_body_member_mask.h +++ b/interfaces/inner_api/feature/update/model/task/task_body_member_mask.h @@ -38,15 +38,15 @@ const std::map g_taskBodyTemplateMap = { { EventId::EVENT_VERSION_INFO_CHANGE, VERSION_DIGEST_INFO | UPGRADE_STATUS }, { EventId::EVENT_DOWNLOAD_WAIT, VERSION_DIGEST_INFO | UPGRADE_STATUS | INSTALL_MODE }, { EventId::EVENT_DOWNLOAD_START, VERSION_DIGEST_INFO | INSTALL_MODE }, - { EventId::EVENT_DOWNLOAD_UPDATE, VERSION_DIGEST_INFO | UPGRADE_STATUS | PROGRESS | INSTALL_MODE }, + { EventId::EVENT_DOWNLOAD_UPDATE, VERSION_DIGEST_INFO | UPGRADE_STATUS | PROGRESS | INSTALL_MODE | SUB_STATUS }, { EventId::EVENT_DOWNLOAD_PAUSE, VERSION_DIGEST_INFO | UPGRADE_STATUS | PROGRESS | INSTALL_MODE | ERROR_MESSAGE }, { EventId::EVENT_DOWNLOAD_RESUME, VERSION_DIGEST_INFO | UPGRADE_STATUS | PROGRESS | INSTALL_MODE }, - { EventId::EVENT_DOWNLOAD_SUCCESS, VERSION_DIGEST_INFO | INSTALL_MODE }, + { EventId::EVENT_DOWNLOAD_SUCCESS, VERSION_DIGEST_INFO | INSTALL_MODE | SUB_STATUS }, { EventId::EVENT_DOWNLOAD_CANCEL, VERSION_DIGEST_INFO | UPGRADE_STATUS }, { EventId::EVENT_DOWNLOAD_FAIL, VERSION_DIGEST_INFO | INSTALL_MODE | ERROR_MESSAGE }, { EventId::EVENT_TRANSFER_WAIT, VERSION_DIGEST_INFO | UPGRADE_STATUS | INSTALL_MODE }, { EventId::EVENT_TRANSFER_START, VERSION_DIGEST_INFO | INSTALL_MODE }, - { EventId::EVENT_TRANSFERING, VERSION_DIGEST_INFO | UPGRADE_STATUS | PROGRESS | INSTALL_MODE }, + { EventId::EVENT_TRANSFERING, VERSION_DIGEST_INFO | UPGRADE_STATUS | PROGRESS | INSTALL_MODE | SUB_STATUS }, { EventId::EVENT_TRANSFER_SUCCESS, VERSION_DIGEST_INFO | INSTALL_MODE }, { EventId::EVENT_TRANSFER_FAIL, VERSION_DIGEST_INFO | ERROR_MESSAGE | INSTALL_MODE }, { EventId::EVENT_UPGRADE_WAIT, VERSION_DIGEST_INFO | UPGRADE_STATUS | INSTALL_MODE | ERROR_MESSAGE }, diff --git a/interfaces/inner_api/include/update_service_kits.h b/interfaces/inner_api/include/update_service_kits.h index f3c8122ae019fe050be4938687e0f8fb77e5f148..39d38b01d55671df7e2d08f0292cf2b1f3cf9b88 100644 --- a/interfaces/inner_api/include/update_service_kits.h +++ b/interfaces/inner_api/include/update_service_kits.h @@ -99,7 +99,7 @@ public: virtual int32_t FactoryReset(BusinessError &businessError) = 0; virtual int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, - const std::string &packageName, BusinessError &businessError) = 0; + const std::vector &packageNames, BusinessError &businessError) = 0; virtual int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) = 0; diff --git a/interfaces/inner_api/modulemgr/include/module_manager.h b/interfaces/inner_api/modulemgr/include/module_manager.h index 7a625ccabfa7ac068f9d3a932e132c04ada1939c..6112a97fb08d8d6596ce144ebc80c4ccc68d1601 100644 --- a/interfaces/inner_api/modulemgr/include/module_manager.h +++ b/interfaces/inner_api/modulemgr/include/module_manager.h @@ -45,14 +45,14 @@ public: void HandleOnStartOnStopFunc(std::string phase, const OHOS::SystemAbilityOnDemandReason &reason); void HookOnIdleFunc(std::string phase, LifeCycleFuncReturnType handleSAOnIdle); int32_t HandleOnIdleFunc(std::string phase, const OHOS::SystemAbilityOnDemandReason &reason); - - static std::map onRemoteRequestFuncMap_; + bool IsMapFuncExist(uint32_t code); private: int32_t retryInterval_ = 0; void *dueModuleHandler = nullptr; static std::map onStartOnStopFuncMap_; static std::map onIdleFuncMap_; + static std::map onRemoteRequestFuncMap_; static bool isLoaded; static std::mutex onRemoteRequestFuncMapMutex_; static std::mutex onStartOnStopFuncMapMutex_; diff --git a/interfaces/inner_api/modulemgr/src/module_manager.cpp b/interfaces/inner_api/modulemgr/src/module_manager.cpp index 019cf1e8ce45a83b080040c6e8740bd759eb64e2..ad4736b07f4b1cf649a49eb444a1744bb1cfa3e8 100644 --- a/interfaces/inner_api/modulemgr/src/module_manager.cpp +++ b/interfaces/inner_api/modulemgr/src/module_manager.cpp @@ -80,22 +80,21 @@ void ModuleManager::HookFunc(std::vector codes, RequestFuncType handle { std::lock_guard guard(onRemoteRequestFuncMapMutex_); for (const uint32_t code : codes) { - if (onRemoteRequestFuncMap_.find(code) == onRemoteRequestFuncMap_.end()) { - UTILS_LOGE("code not exist %{public}d onRemoteRequestFuncMap_", code); + if (!IsMapFuncExist(code)) { + UTILS_LOGI("add code %{public}d", code); onRemoteRequestFuncMap_.insert(std::make_pair(code, handleRemoteRequest)); } else { - UTILS_LOGD("add code %{public}d to onRemoteRequestFuncMap_", code); - onRemoteRequestFuncMap_[code] = handleRemoteRequest; + UTILS_LOGI("code %{public}d already exist", code); } } } int32_t ModuleManager::HandleFunc(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - if (onRemoteRequestFuncMap_.find(code) == onRemoteRequestFuncMap_.end()) { - UTILS_LOGE("HandleFunc code %{public}d not exist", code); + if (!IsMapFuncExist(code)) { + UTILS_LOGI("code %{public}d not exist", code); } else { - UTILS_LOGD("HandleFunc code %{public}d exist", code); + UTILS_LOGI("code %{public}d called", code); return ((RequestFuncType)onRemoteRequestFuncMap_[code])(code, data, reply, option); } return 0; @@ -112,10 +111,10 @@ void ModuleManager::HookOnStartOnStopFunc(std::string phase, LifeCycleFuncType h { std::lock_guard guard(onStartOnStopFuncMapMutex_); if (onStartOnStopFuncMap_.find(phase) == onStartOnStopFuncMap_.end()) { - UTILS_LOGE("phase exist already %{public}s onStartOnStopFuncMap_", phase.c_str()); + UTILS_LOGI("add phase %{public}s", phase.c_str()); onStartOnStopFuncMap_.insert(std::make_pair(phase, handleSAOnStartOnStop)); } else { - UTILS_LOGD("add phase %{public}s to onStartOnStopFuncMap_", phase.c_str()); + UTILS_LOGI("phase %{public}s exist", phase.c_str()); onStartOnStopFuncMap_[phase] = handleSAOnStartOnStop; } } @@ -123,10 +122,10 @@ void ModuleManager::HookOnStartOnStopFunc(std::string phase, LifeCycleFuncType h void ModuleManager::HandleOnStartOnStopFunc(std::string phase, const OHOS::SystemAbilityOnDemandReason &reason) { if (onStartOnStopFuncMap_.find(phase) == onStartOnStopFuncMap_.end()) { - UTILS_LOGE("HandleOnStartOnStopFunc phase %{public}s not exist", phase.c_str()); + UTILS_LOGI("phase %{public}s not exist", phase.c_str()); return; } - UTILS_LOGD("HandleOnStartOnStopFunc phase %{public}s exist", phase.c_str()); + UTILS_LOGI("HandleOnStartOnStopFunc phase %{public}s exist", phase.c_str()); ((LifeCycleFuncType)onStartOnStopFuncMap_[phase])(reason); } @@ -134,10 +133,10 @@ void ModuleManager::HookOnIdleFunc(std::string phase, LifeCycleFuncReturnType ha { std::lock_guard guard(onIdleFuncMapMutex_); if (onIdleFuncMap_.find(phase) == onIdleFuncMap_.end()) { - UTILS_LOGE("phase exist already %{public}s onIdleFuncMap_", phase.c_str()); + UTILS_LOGI("add phase %{public}s", phase.c_str()); onIdleFuncMap_.insert(std::make_pair(phase, handleSAOnIdle)); } else { - UTILS_LOGD("add phase %{public}s to onIdleFuncMap_", phase.c_str()); + UTILS_LOGI("phase %{public}s already exist", phase.c_str()); onIdleFuncMap_[phase] = handleSAOnIdle; } } @@ -145,12 +144,17 @@ void ModuleManager::HookOnIdleFunc(std::string phase, LifeCycleFuncReturnType ha int32_t ModuleManager::HandleOnIdleFunc(std::string phase, const OHOS::SystemAbilityOnDemandReason &reason) { if (onIdleFuncMap_.find(phase) == onIdleFuncMap_.end()) { - UTILS_LOGE("HandleOnIdleFunc phase %{public}s not exist", phase.c_str()); + UTILS_LOGI("phase %{public}s not exist", phase.c_str()); } else { - UTILS_LOGI("HandleOnIdleFunc phase %{public}s exist", phase.c_str()); + UTILS_LOGI("phase %{public}s already exist", phase.c_str()); return ((LifeCycleFuncReturnType)onIdleFuncMap_[phase])(reason); } return 0; } + +bool ModuleManager::IsMapFuncExist(uint32_t code) +{ + return onRemoteRequestFuncMap_.count(code); +} } // namespace UpdateEngine } // namespace OHOS diff --git a/interfaces/inner_api/modulemgr/src/update_service_module.cpp b/interfaces/inner_api/modulemgr/src/update_service_module.cpp index f4a73ebbdc380ede835d1bab3a80a756d2edec44..47c76c7635f2397265d4e208916c66f4a8a1e0ea 100644 --- a/interfaces/inner_api/modulemgr/src/update_service_module.cpp +++ b/interfaces/inner_api/modulemgr/src/update_service_module.cpp @@ -24,7 +24,6 @@ namespace OHOS { namespace UpdateEngine { void RegisterFunc(std::vector codes, RequestFuncType handleRemoteRequest) { - UTILS_LOGI("enter RegisterFunc"); OHOS::UpdateEngine::ModuleManager::GetInstance().HookFunc(codes, handleRemoteRequest); } diff --git a/services/core/ability/callback/src/base_callback_utils.cpp b/services/core/ability/callback/src/base_callback_utils.cpp index 5741a3b267e66e17105212bdf7b5e1dcd96bced8..fa9ef4e6a69e06e78efdf6add882fb3d7fecd295 100644 --- a/services/core/ability/callback/src/base_callback_utils.cpp +++ b/services/core/ability/callback/src/base_callback_utils.cpp @@ -99,7 +99,7 @@ void BaseCallbackUtils::NotifyToHap(EventInfo &info) ENGINE_LOGI("Notify eventInfoStr %{public}s", eventInfoStr.c_str()); if (!eventInfoStr.empty()) { SubscribeInfo subscribeInfo{GetBusinessSubType()}; - OHOS::UpdateEngine::UpdateNotify::NotifyToAppService(eventInfoStr, subscribeInfo.ToJson()); + UpdateNotify::GetInstance()->ConnectToAppService(eventInfoStr, subscribeInfo.ToJson()); } } } // namespace UpdateEngine diff --git a/services/engine/engine_sa.gni b/services/engine/engine_sa.gni index 63facb72a4666e516ba78511d6e2f5cc874e91f5..08d97178044d46f6091c94fcd788be66fe67d029 100644 --- a/services/engine/engine_sa.gni +++ b/services/engine/engine_sa.gni @@ -153,7 +153,7 @@ if (ability_ability_base_enable) { ] } if (ability_ability_runtime_enable) { - sa_external_deps += [ "ability_runtime:ability_manager" ] + sa_external_deps += [ "ability_runtime:extension_manager" ] } if (communication_netmanager_base_enable) { diff --git a/services/engine/include/i_update_notify.h b/services/engine/include/i_update_notify.h new file mode 100644 index 0000000000000000000000000000000000000000..6bc41c01ae204e04393a1c296ec3c7e497de7673 --- /dev/null +++ b/services/engine/include/i_update_notify.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_UPDATE_NOTIFY_H +#define I_UPDATE_NOTIFY_H + +#include + +#include "iremote_broker.h" + +namespace OHOS::UpdateEngine { +class IUpdateNotify : public OHOS::IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Updater.IUpdateNotify"); +}; +} // namespace OHOS::UpdateEngine +#endif // I_UPDATE_NOTIFY_H \ No newline at end of file diff --git a/services/engine/include/update_notify.h b/services/engine/include/update_notify.h index a89c70b324ace8cf053771688547c0a73f1327e1..91be2ab087131e1bf71e890d8ec9d6660593684d 100644 --- a/services/engine/include/update_notify.h +++ b/services/engine/include/update_notify.h @@ -16,40 +16,59 @@ #ifndef UPDATE_NOTIFY_H #define UPDATE_NOTIFY_H +#include +#include #include #include "ability_connect_callback_stub.h" #include "ability_connect_callback_interface.h" #include "ability_manager_interface.h" #include "ability_manager_client.h" #include "if_system_ability_manager.h" +#include "i_update_notify.h" #include "system_ability_definition.h" #include "update_no_constructor.h" #include "want.h" namespace OHOS { namespace UpdateEngine { -class UpdateNotify : public NoConstructor { +class UpdateNotify : public IRemoteStub { public: - static bool NotifyToAppService(const std::string &eventInfo, const std::string &subscribeInfo); + DISALLOW_COPY_AND_MOVE(UpdateNotify); + + UpdateNotify(); + ~UpdateNotify(); + static sptr GetInstance(); + bool ConnectToAppService(const std::string &eventInfo, const std::string &subscribeInfo); + void HandleAbilityConnect(const sptr &remoteObject); + +private: + bool HandleMessage(const std::string &message); + ErrCode ConnectAbility(const AAFwk::Want &want, const sptr &connect); + ErrCode DisconnectAbility(const sptr &connect); private: - static ErrCode ConnectAbility(const AAFwk::Want &want, const sptr &connect, - const sptr &callerToken); - static ErrCode DisconnectAbility(const sptr &connect); - static ErrCode StopServiceAbility(const AAFwk::Want &want); - static ErrCode StartAbility(const AAFwk::Want &want); - static AAFwk::Want MakeWant(const std::string &deviceId, const std::string &abilityName, - const std::string &bundleName, const std::string &subscribeInfo, const std::string ¶ms = {}); + static std::mutex instanceLock_; + static sptr instance_; + sptr remoteObject_ = nullptr; + std::mutex connectMutex_; + std::condition_variable conditionVal_; + + enum class UpdateAppCode { + UNKNOWN = 0, + UPDATE_APP = 5 + }; }; class NotifyConnection : public AAFwk::AbilityConnectionStub { public: - explicit NotifyConnection() = default; + explicit NotifyConnection(const sptr &instance); ~NotifyConnection() = default; - void OnAbilityConnectDone(const AppExecFwk::ElementName &element, const sptr &remoteObject, int32_t resultCode) override; void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override; + +private: + sptr instance_ = nullptr; }; } // namespace UpdateEngine } // namespace OHOS diff --git a/services/engine/include/update_service.h b/services/engine/include/update_service.h index 0090f95b56b524c48b75501e719af2c9c4d9df6e..a123318f0677f1f1381dd6e6aaa6f28fb2d8bed6 100644 --- a/services/engine/include/update_service.h +++ b/services/engine/include/update_service.h @@ -83,14 +83,16 @@ public: int32_t FactoryReset(BusinessError &businessError) override; - int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, const std::string &packageName, - BusinessError &businessError) override; + int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, + const std::vector &packageNames, BusinessError &businessError) override; int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) override; int Dump(int fd, const std::vector &args) override; + void RegisterOhFunc(); + static sptr GetInstance(); sptr GetUpgradeCallback(const UpgradeInfo &info); diff --git a/services/engine/include/update_service_local_updater.h b/services/engine/include/update_service_local_updater.h index 8e8f5e908270f7652cccba9d56f9cca36e01de68..84e102598f3e8afbba85020c1d476e1ceeaa8a5a 100644 --- a/services/engine/include/update_service_local_updater.h +++ b/services/engine/include/update_service_local_updater.h @@ -30,8 +30,8 @@ public: DISALLOW_COPY_AND_MOVE(UpdateServiceLocalUpdater); - int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, const std::string &packageName, - BusinessError &businessError) final; + int32_t ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, + const std::vector &packageNames, BusinessError &businessError) final; int32_t VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, BusinessError &businessError) final; diff --git a/services/engine/src/progress_thread.cpp b/services/engine/src/progress_thread.cpp index 029f10d0303218ab3f0eb9fdf5c80d8ee9f48ab0..24d85dccc6ffb2fe473b3ba3dde0158f5f66c9de 100644 --- a/services/engine/src/progress_thread.cpp +++ b/services/engine/src/progress_thread.cpp @@ -51,7 +51,7 @@ int32_t ProgressThread::StartProgress() { std::unique_lock lock(mutex_); if (pDealThread_ == nullptr) { - pDealThread_ = new (std::nothrow)std::thread(&ProgressThread::ExecuteThreadFunc, this); + pDealThread_ = new (std::nothrow)std::thread([this] { this->ExecuteThreadFunc(); }); ENGINE_CHECK(pDealThread_ != nullptr, return -1, "Failed to create thread"); } ENGINE_LOGI("StartProgress"); diff --git a/services/engine/src/update_notify.cpp b/services/engine/src/update_notify.cpp index 01000ac15916bf3d209314d6e8fc8762b06d6721..18db4f2700c70424a50a39404b0c1a46eb02a977 100644 --- a/services/engine/src/update_notify.cpp +++ b/services/engine/src/update_notify.cpp @@ -15,6 +15,8 @@ #include "update_notify.h" +#include "cJSON.h" +#include "extension_manager_client.h" #include "iservice_registry.h" #include "subscribe_info.h" @@ -22,62 +24,129 @@ namespace OHOS { namespace UpdateEngine { -ErrCode UpdateNotify::StartAbility(const AAFwk::Want &want) +std::mutex UpdateNotify::instanceLock_; +sptr UpdateNotify::instance_ = nullptr; + +UpdateNotify::UpdateNotify() { - ErrCode result = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want); - ENGINE_LOGI("StartAbility result %{public}d", result); - return result; + ENGINE_LOGD("UpdateNotify"); } -ErrCode UpdateNotify::StopServiceAbility(const AAFwk::Want &want) +UpdateNotify::~UpdateNotify() { - ErrCode result = AAFwk::AbilityManagerClient::GetInstance()->StopServiceAbility(want); - ENGINE_LOGI("StopServiceAbility result %{public}d", result); - return result; + ENGINE_LOGD("~UpdateNotify"); +} + +sptr UpdateNotify::GetInstance() +{ + if (instance_ == nullptr) { + std::lock_guard autoLock(instanceLock_); + if (instance_ == nullptr) { + instance_ = new UpdateNotify(); + } + } + return instance_; } -ErrCode UpdateNotify::ConnectAbility(const AAFwk::Want &want, const sptr &connect, - const sptr &callerToken) +ErrCode UpdateNotify::ConnectAbility(const AAFwk::Want &want, const sptr &connect) { - ErrCode result = AAFwk::AbilityManagerClient::GetInstance()->ConnectAbility(want, connect, callerToken); + ErrCode result = + AAFwk::ExtensionManagerClient::GetInstance().ConnectServiceExtensionAbility(want, connect, nullptr, -1); ENGINE_LOGI("ConnectAbility result %{public}d", result); return result; } -ErrCode UpdateNotify::DisconnectAbility(const sptr &connect) +ErrCode UpdateNotify::DisconnectAbility(const sptr &connect) { - ErrCode result = AAFwk::AbilityManagerClient::GetInstance()->DisconnectAbility(connect); + ErrCode result = + AAFwk::ExtensionManagerClient::GetInstance().DisconnectAbility(connect); ENGINE_LOGI("DisconnectAbility result %{public}d", result); return result; } -AAFwk::Want UpdateNotify::MakeWant(const std::string &deviceId, const std::string &abilityName, - const std::string &bundleName, const std::string &subscribeInfo, const std::string ¶ms) +bool UpdateNotify::ConnectToAppService(const std::string &eventInfo, const std::string &subscribeInfo) { - AppExecFwk::ElementName element(deviceId, bundleName, abilityName); - AAFwk::Want want; - want.SetElement(element); - want.SetParam("EventInfo", params); - want.SetParam("SubscribeInfo", subscribeInfo); - return want; + if (eventInfo.empty()) { + ENGINE_LOGE("ConnectToAppService eventInfo error."); + return false; + } + cJSON *root = cJSON_CreateObject(); + cJSON_AddItemToObject(root, "EventInfo", cJSON_Parse(eventInfo.c_str())); + cJSON_AddItemToObject(root, "SubscribeInfo", cJSON_Parse(subscribeInfo.c_str())); + + char *data = cJSON_PrintUnformatted(root); + if (data == nullptr) { + cJSON_Delete(root); + return false; + } + std::string message = std::string(data); + cJSON_free(data); + cJSON_Delete(root); + return HandleMessage(message); } -bool UpdateNotify::NotifyToAppService(const std::string &eventInfo, const std::string &subscribeInfo) +bool UpdateNotify::HandleMessage(const std::string &message) { - if (eventInfo.empty()) { - ENGINE_LOGE("NotifyToAppService eventInfo error."); + std::string bundleName = UPDATE_APP_PACKAGE_NAME; + std::string abilityName = UPDATE_APP_SERVICE_EXT_ABILITY_NAME; + AAFwk::Want want; + want.SetElementName(bundleName, abilityName); + want.SetParam("Timeout", UPDATE_APP_TIMEOUT); + auto connect = sptr::MakeSptr(instance_); + int ret = ConnectAbility(want, connect); + std::unique_lock uniqueLock(connectMutex_); + conditionVal_.wait_for(uniqueLock, std::chrono::seconds(UPDATE_APP_CONNECT_TIMEOUT)); + if (ret != OHOS::ERR_OK || remoteObject_ == nullptr) { + ENGINE_LOGE("HandleMessage, can not connect to ouc"); return false; } - std::string bundleName = OUC_PACKAGE_NAME; - std::string abilityName = OUC_SERVICE_EXT_ABILITY_NAME; - AAFwk::Want want = MakeWant("", abilityName, bundleName, subscribeInfo, eventInfo); - return StartAbility(want) == OHOS::ERR_OK; + + MessageParcel data; + if (!data.WriteString16(Str8ToStr16(message))) { + ENGINE_LOGE("HandleMessage, write message failed"); + return false; + } + + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + int32_t result = remoteObject_->SendRequest(CAST_INT(UpdateAppCode::UPDATE_APP), data, reply, option); + if (result != 0) { + ENGINE_LOGE("HandleMessage SendRequest, error result %{public}d", result); + DisconnectAbility(connect); + return false; + } + return true; +} + +void UpdateNotify::HandleAbilityConnect(const sptr &remoteObject) +{ + remoteObject_ = remoteObject; + conditionVal_.notify_one(); +} + +NotifyConnection::NotifyConnection(const sptr &instance) +{ + ENGINE_LOGD("NotifyConnection constructor"); + instance_ = instance; } void NotifyConnection::OnAbilityConnectDone(const AppExecFwk::ElementName &element, const sptr &remoteObject, int32_t resultCode) { ENGINE_LOGI("OnAbilityConnectDone successfully. result %{public}d", resultCode); + if (resultCode != ERR_OK) { + ENGINE_LOGE("ability connect failed, error code: %{public}d", resultCode); + return; + } + ENGINE_LOGI("ability connect success, ability name %{public}s", element.GetAbilityName().c_str()); + if (remoteObject == nullptr) { + ENGINE_LOGE("get remoteObject failed"); + return; + } + if (instance_ == nullptr) { + return; + } + instance_->HandleAbilityConnect(remoteObject); } void NotifyConnection::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) diff --git a/services/engine/src/update_service.cpp b/services/engine/src/update_service.cpp index 5071ee0f4bfe87cd4d1ada12a94decabcc0a6e0c..b31582aa5235f221542f43d00b27788120252bcd 100644 --- a/services/engine/src/update_service.cpp +++ b/services/engine/src/update_service.cpp @@ -323,14 +323,14 @@ int32_t UpdateService::FactoryReset(BusinessError &businessError) } int32_t UpdateService::ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, - const std::string &packageName, BusinessError &businessError) + const std::vector &packageNames, BusinessError &businessError) { sptr localUpdater = new UpdateServiceLocalUpdater(); if (localUpdater == nullptr) { ENGINE_LOGI("FactoryReset localUpdater null"); return INT_CALL_FAIL; } - return localUpdater->ApplyNewVersion(info, miscFile, packageName, businessError); + return localUpdater->ApplyNewVersion(info, miscFile, packageNames, businessError); } int32_t UpdateService::VerifyUpgradePackage(const std::string &packagePath, const std::string &keyPath, @@ -430,38 +430,16 @@ void UpdateService::OnStart(const SystemAbilityOnDemandReason &startReason) ENGINE_LOGE("updateService_ null"); } - std::vector codes = { - CAST_UINT(UpdaterSaInterfaceCode::CHECK_VERSION), - CAST_UINT(UpdaterSaInterfaceCode::DOWNLOAD), - CAST_UINT(UpdaterSaInterfaceCode::PAUSE_DOWNLOAD), - CAST_UINT(UpdaterSaInterfaceCode::RESUME_DOWNLOAD), - CAST_UINT(UpdaterSaInterfaceCode::UPGRADE), - CAST_UINT(UpdaterSaInterfaceCode::CLEAR_ERROR), - CAST_UINT(UpdaterSaInterfaceCode::TERMINATE_UPGRADE), - CAST_UINT(UpdaterSaInterfaceCode::SET_POLICY), - CAST_UINT(UpdaterSaInterfaceCode::GET_POLICY), - CAST_UINT(UpdaterSaInterfaceCode::GET_NEW_VERSION), - CAST_UINT(UpdaterSaInterfaceCode::GET_NEW_VERSION_DESCRIPTION), - CAST_UINT(UpdaterSaInterfaceCode::GET_CURRENT_VERSION), - CAST_UINT(UpdaterSaInterfaceCode::GET_CURRENT_VERSION_DESCRIPTION), - CAST_UINT(UpdaterSaInterfaceCode::GET_TASK_INFO), - CAST_UINT(UpdaterSaInterfaceCode::REGISTER_CALLBACK), - CAST_UINT(UpdaterSaInterfaceCode::UNREGISTER_CALLBACK), - CAST_UINT(UpdaterSaInterfaceCode::CANCEL), - CAST_UINT(UpdaterSaInterfaceCode::FACTORY_RESET), - CAST_UINT(UpdaterSaInterfaceCode::APPLY_NEW_VERSION), - CAST_UINT(UpdaterSaInterfaceCode::VERIFY_UPGRADE_PACKAGE) - }; - ENGINE_LOGI("RegisterFunc HandleOhRemoteRequest"); - RegisterFunc(codes, HandleOhRemoteRequest); - DelayedSingleton::GetInstance()->LoadConfigInfo(); // 启动读取配置信息 std::string libPath = DelayedSingleton::GetInstance()->GetModuleLibPath(); ENGINE_LOGI("GetModuleLibPath %{public}s ", libPath.c_str()); ModuleManager::GetInstance().LoadModule(libPath); + ENGINE_LOGI("RegisterOhFunc HandleOhRemoteRequest"); + RegisterOhFunc(); + if (!ModuleManager::GetInstance().IsModuleLoaded()) { - ENGINE_LOGI("IsModuleLoaded false, init blue"); + ENGINE_LOGI("IsModuleLoaded false, init updateservice_sa"); DelayedSingleton::GetInstance()->Init(); // 动态启停流程启动 @@ -496,5 +474,32 @@ int32_t HandleOhRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel { return UpdateService::GetInstance()-> HandleRemoteRequest(code, data, reply, option); } + +void UpdateService::RegisterOhFunc() +{ + std::vector codes = { + CAST_UINT(UpdaterSaInterfaceCode::CHECK_VERSION), + CAST_UINT(UpdaterSaInterfaceCode::DOWNLOAD), + CAST_UINT(UpdaterSaInterfaceCode::PAUSE_DOWNLOAD), + CAST_UINT(UpdaterSaInterfaceCode::RESUME_DOWNLOAD), + CAST_UINT(UpdaterSaInterfaceCode::UPGRADE), + CAST_UINT(UpdaterSaInterfaceCode::CLEAR_ERROR), + CAST_UINT(UpdaterSaInterfaceCode::TERMINATE_UPGRADE), + CAST_UINT(UpdaterSaInterfaceCode::SET_POLICY), + CAST_UINT(UpdaterSaInterfaceCode::GET_POLICY), + CAST_UINT(UpdaterSaInterfaceCode::GET_NEW_VERSION), + CAST_UINT(UpdaterSaInterfaceCode::GET_NEW_VERSION_DESCRIPTION), + CAST_UINT(UpdaterSaInterfaceCode::GET_CURRENT_VERSION), + CAST_UINT(UpdaterSaInterfaceCode::GET_CURRENT_VERSION_DESCRIPTION), + CAST_UINT(UpdaterSaInterfaceCode::GET_TASK_INFO), + CAST_UINT(UpdaterSaInterfaceCode::REGISTER_CALLBACK), + CAST_UINT(UpdaterSaInterfaceCode::UNREGISTER_CALLBACK), + CAST_UINT(UpdaterSaInterfaceCode::CANCEL), + CAST_UINT(UpdaterSaInterfaceCode::FACTORY_RESET), + CAST_UINT(UpdaterSaInterfaceCode::APPLY_NEW_VERSION), + CAST_UINT(UpdaterSaInterfaceCode::VERIFY_UPGRADE_PACKAGE) + }; + RegisterFunc(codes, HandleOhRemoteRequest); +} } // namespace UpdateEngine } // namespace OHOS diff --git a/services/engine/src/update_service_impl_firmware.cpp b/services/engine/src/update_service_impl_firmware.cpp index 040f9cacd85b475c91482f12d4197e1e02938d51..6f64138e5aaeec30e393f5abd9e218a6f313d5b4 100644 --- a/services/engine/src/update_service_impl_firmware.cpp +++ b/services/engine/src/update_service_impl_firmware.cpp @@ -182,7 +182,13 @@ int32_t UpdateServiceImplFirmware::GetNewVersionDescription(const UpgradeInfo &i return INT_CALL_SUCCESS; } std::string dataXml = FileUtils::ReadDataFromFile(changelogFilePath); - std::string dataXmlFinal = dataXml.substr(dataXml.find_first_of("|") + 1, dataXml.size()); + size_t startIndex = dataXml.find_first_of("|"); + if (startIndex == std::string::npos) { + FIRMWARE_LOGE("dataXml not found |"); + businessError.Build(CallResult::FAIL, "GetNewVersionDescription failed"); + return INT_CALL_SUCCESS; + } + std::string dataXmlFinal = dataXml.substr(startIndex + 1, dataXml.size()); GetChangelogContent(dataXmlFinal, descriptionOptions.language); componentDescription.descriptionInfo.content = dataXmlFinal; componentDescription.descriptionInfo.descriptionType = @@ -225,7 +231,13 @@ int32_t UpdateServiceImplFirmware::GetCurrentVersionDescription(const UpgradeInf return INT_CALL_SUCCESS; } std::string dataXml = FileUtils::ReadDataFromFile(changelogFilePath); - std::string dataXmlFinal = dataXml.substr(dataXml.find_first_of("|") + 1, dataXml.size()); + size_t startIndex = dataXml.find_first_of("|"); + if (startIndex == std::string::npos) { + FIRMWARE_LOGE("dataXml not found |"); + businessError.Build(CallResult::FAIL, "GetCurrentVersionDescription failed"); + return INT_CALL_SUCCESS; + } + std::string dataXmlFinal = dataXml.substr(startIndex + 1, dataXml.size()); GetChangelogContent(dataXmlFinal, descriptionOptions.language); descriptionContent.descriptionInfo.content = dataXmlFinal; descriptionContent.descriptionInfo.descriptionType = diff --git a/services/engine/src/update_service_local_updater.cpp b/services/engine/src/update_service_local_updater.cpp index 7f290737b30c417dbac78d76af79ace59f2eb569..1197b87226025a7aa108517b44f1877fd83e6d82 100644 --- a/services/engine/src/update_service_local_updater.cpp +++ b/services/engine/src/update_service_local_updater.cpp @@ -25,13 +25,11 @@ namespace OHOS { namespace UpdateEngine { int32_t UpdateServiceLocalUpdater::ApplyNewVersion(const UpgradeInfo &info, const std::string &miscFile, - const std::string &packageName, BusinessError &businessError) + const std::vector &packageNames, BusinessError &businessError) { #ifndef UPDATER_UT SYS_EVENT_SYSTEM_UPGRADE(0, UpdateSystemEvent::UPGRADE_START); businessError.errorNum = CallResult::SUCCESS; - std::vector packageNames; - packageNames.push_back(packageName); int32_t ret = RebootAndInstallSdcardPackage(miscFile, packageNames) ? INT_CALL_SUCCESS : INT_CALL_FAIL; ENGINE_LOGI("ApplyNewVersion result : %{public}d", ret); SYS_EVENT_SYSTEM_UPGRADE( diff --git a/services/engine/src/update_service_stub.cpp b/services/engine/src/update_service_stub.cpp index c862be67e6b3ccec0b2ddbe9573531e7324d3780..4e1966af5b3dc5cd7a875f14ebfad6010343e839 100644 --- a/services/engine/src/update_service_stub.cpp +++ b/services/engine/src/update_service_stub.cpp @@ -34,6 +34,7 @@ namespace OHOS { namespace UpdateEngine { constexpr const pid_t ROOT_UID = 0; constexpr const pid_t EDM_UID = 3057; +static constexpr int32_t MAX_VECTOR_SIZE = 128; #define CALL_RESULT_TO_IPC_RESULT(callResult) ((callResult) + CALL_RESULT_OFFSET) @@ -356,9 +357,18 @@ int32_t UpdateServiceStub::ApplyNewVersionStub(UpdateServiceStubPtr service, UpgradeInfo upgradeInfo; MessageParcelHelper::ReadUpgradeInfo(data, upgradeInfo); string miscFile = Str16ToStr8(data.ReadString16()); - string packageName = Str16ToStr8(data.ReadString16()); + + vector packageNames; + int32_t size = data.ReadInt32(); + if (size > MAX_VECTOR_SIZE) { + ENGINE_LOGE("ReadComponentDescriptions size is over, size=%{public}d", size); + return INT_CALL_FAIL; + } + for (size_t i = 0; i < static_cast(size); i++) { + packageNames.emplace_back(Str16ToStr8(data.ReadString16())); + } BusinessError businessError; - int32_t ret = service->ApplyNewVersion(upgradeInfo, miscFile, packageName, businessError); + int32_t ret = service->ApplyNewVersion(upgradeInfo, miscFile, packageNames, businessError); ENGINE_CHECK(ret == INT_CALL_SUCCESS, return ret, "Failed to ApplyNewVersion"); MessageParcelHelper::WriteBusinessError(reply, businessError); return INT_CALL_SUCCESS; @@ -417,8 +427,7 @@ int32_t UpdateServiceStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption &option) { ENGINE_LOGI("UpdateServiceStub func code %{public}u", code); - auto iter = ModuleManager::onRemoteRequestFuncMap_.find(code); - if (iter == ModuleManager::onRemoteRequestFuncMap_.end()) { + if (!ModuleManager::GetInstance().IsMapFuncExist(code)) { ENGINE_LOGE("UpdateServiceStub OnRemoteRequest code %{public}u not found", code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } diff --git a/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp b/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp index 9a27865e33d494063ffe572a9df34d35e0759e7a..752dfdf0d52a836a1119218b2bab0458994f65d3 100644 --- a/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_apply_executor.cpp @@ -32,7 +32,7 @@ namespace UpdateEngine { void FirmwareApplyExecutor::Execute() { FIRMWARE_LOGI("FirmwareApplyExecutor::Execute"); - std::thread installThread(&FirmwareApplyExecutor::DoInstall, this); + std::thread installThread([this] { this->DoInstall(); }); installThread.detach(); } diff --git a/services/firmware/upgrade/executor/src/firmware_check_executor.cpp b/services/firmware/upgrade/executor/src/firmware_check_executor.cpp index 7a9c0f8e285d4ee2805d626e38b6bd573c19248f..d601eca0ca512b63bdd9893dd58eaaaaac194dba 100644 --- a/services/firmware/upgrade/executor/src/firmware_check_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_check_executor.cpp @@ -32,7 +32,7 @@ void FirmwareCheckExecutor::Execute() { FIRMWARE_LOGI("FirmwareCheckExecutor::Execute"); DelayedSingleton::GetInstance()->SetIsChecking(true); - std::thread checkThread(&FirmwareCheckExecutor::DoCheck, this); + std::thread checkThread([this] { this->DoCheck(); }); checkThread.detach(); } diff --git a/services/firmware/upgrade/executor/src/firmware_download_executor.cpp b/services/firmware/upgrade/executor/src/firmware_download_executor.cpp index b9ee76c6f2af4988989b2143493dbbc477524963..4c246e7e92e3257c028f290e4db1333a363b3473 100644 --- a/services/firmware/upgrade/executor/src/firmware_download_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_download_executor.cpp @@ -37,7 +37,7 @@ const mode_t MKDIR_MODE = 0777; void FirmwareDownloadExecutor::Execute() { FIRMWARE_LOGI("FirmwareDownloadExecutor::Execute"); - std::thread downloadThread(&FirmwareDownloadExecutor::DoDownload, this); + std::thread downloadThread([this] { this->DoDownload(); }); downloadThread.detach(); } diff --git a/services/firmware/upgrade/executor/src/firmware_install_executor.cpp b/services/firmware/upgrade/executor/src/firmware_install_executor.cpp index 8ea8b4c2efdf63a3b7d0ca5a27c676fad1eff920..0062393d52161d2bd1fea187735e18f1e48a15ec 100644 --- a/services/firmware/upgrade/executor/src/firmware_install_executor.cpp +++ b/services/firmware/upgrade/executor/src/firmware_install_executor.cpp @@ -30,7 +30,7 @@ namespace UpdateEngine { void FirmwareInstallExecutor::Execute() { FIRMWARE_LOGI("FirmwareInstallExecutor::Execute"); - std::thread installThread(&FirmwareInstallExecutor::DoInstall, this); + std::thread installThread([this] { this->DoInstall(); }); installThread.detach(); } diff --git a/services/firmware/upgrade/flow/src/firmware_manager.cpp b/services/firmware/upgrade/flow/src/firmware_manager.cpp index cb520ad6136a09f7db2695fa1b4a69318b222019..5303b39bfc8c6b97181f4803d2c18acba29a26b1 100644 --- a/services/firmware/upgrade/flow/src/firmware_manager.cpp +++ b/services/firmware/upgrade/flow/src/firmware_manager.cpp @@ -75,7 +75,7 @@ void FirmwareManager::Init(StartupReason startupReason) } FileUtils::InitAndCreateBaseDirs(FIRMWARE_DIR_INFOS); - std::thread initThread(&FirmwareManager::DelayInit, this, startupReason); + std::thread initThread([this, startupReason] { this->DelayInit(startupReason); }); initThread.detach(); } @@ -177,10 +177,11 @@ void FirmwareManager::DoTerminateUpgrade(BusinessError &businessError) } // 主线程拉起子线程之后向OUC返回回调结果,子线程sleep 1秒之后,DUE进程退出 - std::thread th = std::thread([this]() { + auto execFunc = []() { sleep(PROCESS_EXIT_DELAY_TIME); _Exit(0); - }); + }; + std::thread th = std::thread(execFunc); th.detach(); } diff --git a/services/utils/src/dupdate_net_observer.cpp b/services/utils/src/dupdate_net_observer.cpp index 3e245d844fd93cb7a7931335c5800c57e8fa5009..30a1832f4de6ad7f08f6d9a34ed710d41470e5c2 100644 --- a/services/utils/src/dupdate_net_observer.cpp +++ b/services/utils/src/dupdate_net_observer.cpp @@ -37,7 +37,7 @@ void NetObserver::SetCallback(const std::weak_ptr &callbac void NetObserver::StartObserver() { ENGINE_LOGI("StartObserver"); - std::thread th = std::thread([this]() { + auto observerExecFunc = [this]() { NetSpecifier netSpecifier; NetAllCapabilities netAllCapabilities; netAllCapabilities.netCaps_.insert(NetManagerStandard::NetCap::NET_CAPABILITY_INTERNET); @@ -58,7 +58,8 @@ void NetObserver::StartObserver() sleep(1); } while (retryCount < RETRY_MAX_TIMES); ENGINE_LOGE("StartObserver failed"); - }); + }; + std::thread th = std::thread(observerExecFunc); th.detach(); } diff --git a/test/fuzztest/updateservicecancel_fuzzer/BUILD.gn b/test/fuzztest/updateservicecancel_fuzzer/BUILD.gn index ae2965fd340a28ee9d901b0d6f29690902f79b69..a0b769b69ce300e39ff4c7350ba1300ccae5c382 100644 --- a/test/fuzztest/updateservicecancel_fuzzer/BUILD.gn +++ b/test/fuzztest/updateservicecancel_fuzzer/BUILD.gn @@ -42,7 +42,7 @@ ohos_fuzztest("UpdateServiceCancelFuzzTest") { ] deps = [ "$updateengine_root_path/interfaces/inner_api/engine:$updateengine_inner_library_name" ] external_deps = [ - "ability_runtime:ability_manager", + "ability_runtime:extension_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", diff --git a/test/fuzztest/updateservicechecknewversion_fuzzer/BUILD.gn b/test/fuzztest/updateservicechecknewversion_fuzzer/BUILD.gn index 04be0847822491b55bb1ec27df24298dae1a78f5..477bafb51a728d8d21b7ece7adf326acb4914cab 100644 --- a/test/fuzztest/updateservicechecknewversion_fuzzer/BUILD.gn +++ b/test/fuzztest/updateservicechecknewversion_fuzzer/BUILD.gn @@ -41,7 +41,7 @@ ohos_fuzztest("UpdateServiceCheckNewVersionFuzzTest") { ] deps = [ "$updateengine_root_path/interfaces/inner_api/engine:$updateengine_inner_library_name" ] external_deps = [ - "ability_runtime:ability_manager", + "ability_runtime:extension_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", diff --git a/test/fuzztest/updateservicedownload_fuzzer/BUILD.gn b/test/fuzztest/updateservicedownload_fuzzer/BUILD.gn index 5e567292c96e28bb3dab805b40b5c874f31999a7..3ba5fba13a37fb73d1396124fa1f80c680283844 100644 --- a/test/fuzztest/updateservicedownload_fuzzer/BUILD.gn +++ b/test/fuzztest/updateservicedownload_fuzzer/BUILD.gn @@ -42,7 +42,7 @@ ohos_fuzztest("UpdateServiceDownloadFuzzTest") { ] deps = [ "$updateengine_root_path/interfaces/inner_api/engine:$updateengine_inner_library_name" ] external_deps = [ - "ability_runtime:ability_manager", + "ability_runtime:extension_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", diff --git a/test/fuzztest/updateservicegetnewversion_fuzzer/BUILD.gn b/test/fuzztest/updateservicegetnewversion_fuzzer/BUILD.gn index 044b27f02842760cd02c5db96ac0818c91a5098e..0a94c4406735b6c2eb3a50eaaa9b22545c4e3a0c 100644 --- a/test/fuzztest/updateservicegetnewversion_fuzzer/BUILD.gn +++ b/test/fuzztest/updateservicegetnewversion_fuzzer/BUILD.gn @@ -42,7 +42,7 @@ ohos_fuzztest("UpdateServiceGetNewVersionFuzzTest") { ] deps = [ "$updateengine_root_path/interfaces/inner_api/engine:$updateengine_inner_library_name" ] external_deps = [ - "ability_runtime:ability_manager", + "ability_runtime:extension_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", diff --git a/test/fuzztest/updateservicegetupgradepolicy_fuzzer/BUILD.gn b/test/fuzztest/updateservicegetupgradepolicy_fuzzer/BUILD.gn index 9167ea5df08ddfc6a9202d8ddf5031c33b074a30..f44ab3bac69fa11532123e2d6ddf7311d3f04d60 100644 --- a/test/fuzztest/updateservicegetupgradepolicy_fuzzer/BUILD.gn +++ b/test/fuzztest/updateservicegetupgradepolicy_fuzzer/BUILD.gn @@ -41,7 +41,7 @@ ohos_fuzztest("UpdateServiceGetUpgradePolicyFuzzTest") { ] deps = [ "$updateengine_root_path/interfaces/inner_api/engine:$updateengine_inner_library_name" ] external_deps = [ - "ability_runtime:ability_manager", + "ability_runtime:extension_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", diff --git a/test/fuzztest/updateserviceregisterupdatecallback_fuzzer/BUILD.gn b/test/fuzztest/updateserviceregisterupdatecallback_fuzzer/BUILD.gn index d1aad60b048b1155579c8ba6f2e57eb90b304534..d32f09ec24b5323d83599e251a015eb0f38c5993 100644 --- a/test/fuzztest/updateserviceregisterupdatecallback_fuzzer/BUILD.gn +++ b/test/fuzztest/updateserviceregisterupdatecallback_fuzzer/BUILD.gn @@ -41,7 +41,7 @@ ohos_fuzztest("UpdateServiceRegisterUpdateCallbackFuzzTest") { ] deps = [ "$updateengine_root_path/interfaces/inner_api/engine:$updateengine_inner_library_name" ] external_deps = [ - "ability_runtime:ability_manager", + "ability_runtime:extension_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", diff --git a/test/fuzztest/updateservicesetupgradepolicy_fuzzer/BUILD.gn b/test/fuzztest/updateservicesetupgradepolicy_fuzzer/BUILD.gn index 828bf3f0201505d651f29d085430a3cbf1656759..7294884c86f81cac7671057e7d191a6a5b7e37d3 100644 --- a/test/fuzztest/updateservicesetupgradepolicy_fuzzer/BUILD.gn +++ b/test/fuzztest/updateservicesetupgradepolicy_fuzzer/BUILD.gn @@ -42,7 +42,7 @@ ohos_fuzztest("UpdateServiceSetUpgradePolicyFuzzTest") { ] deps = [ "$updateengine_root_path/interfaces/inner_api/engine:$updateengine_inner_library_name" ] external_deps = [ - "ability_runtime:ability_manager", + "ability_runtime:extension_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", diff --git a/test/fuzztest/updateserviceunregisterupdatecallback_fuzzer/BUILD.gn b/test/fuzztest/updateserviceunregisterupdatecallback_fuzzer/BUILD.gn index 9e4fe061e8e1a725c27c793880f3881322a80aee..772f1b062542ff238ccff8349829349c904dfe9f 100644 --- a/test/fuzztest/updateserviceunregisterupdatecallback_fuzzer/BUILD.gn +++ b/test/fuzztest/updateserviceunregisterupdatecallback_fuzzer/BUILD.gn @@ -41,7 +41,7 @@ ohos_fuzztest("UpdateServiceUnregisterUpdateCallbackFuzzTest") { ] deps = [ "$updateengine_root_path/interfaces/inner_api/engine:$updateengine_inner_library_name" ] external_deps = [ - "ability_runtime:ability_manager", + "ability_runtime:extension_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc",