diff --git a/interfaces/inner_api/src/form_mgr_proxy.cpp b/interfaces/inner_api/src/form_mgr_proxy.cpp index 1b205f05be8370ea9138374e88715b6da1e28334..aa32b9fd77ab2012f0d60b9f7c264f6968512525 100644 --- a/interfaces/inner_api/src/form_mgr_proxy.cpp +++ b/interfaces/inner_api/src/form_mgr_proxy.cpp @@ -1139,7 +1139,7 @@ int FormMgrProxy::GetFormsInfoByApp(std::string &bundleName, std::vectorGetFormsInfoByModule(bundleName, moduleName, formInfos); if (resultCode != ERR_OK) { - HILOG_ERROR("failed to GetFormsInfoByApp, error code is %{public}d.", resultCode); + HILOG_ERROR("failed to GetFormsInfoByModule, error code is %{public}d.", resultCode); } return resultCode; } diff --git a/services/form_render_service/src/form_render_record.cpp b/services/form_render_service/src/form_render_record.cpp index a69f8e88f165761658b17c3686b99300d35f7ca3..4b5c9a75e621080d3b8fadd9d87a178889187b33 100644 --- a/services/form_render_service/src/form_render_record.cpp +++ b/services/form_render_service/src/form_render_record.cpp @@ -327,7 +327,7 @@ int32_t FormRenderRecord::UpdateRenderRecord(const FormJsInfo &formJsInfo, const } if (hostRemoteObj == nullptr) { - HILOG_ERROR("hostRemoteObj is nullptr"); + HILOG_WARN("hostRemoteObj is nullptr"); return RENDER_FORM_FAILED; } std::lock_guard lock(hostsMapMutex_); diff --git a/services/src/form_info_mgr.cpp b/services/src/form_info_mgr.cpp index d0957ecb0e42a7b2edc99e6081df7dcdf163caa9..0e41043101e0576be88b803c344f7cc2419d9021 100644 --- a/services/src/form_info_mgr.cpp +++ b/services/src/form_info_mgr.cpp @@ -75,12 +75,7 @@ ErrCode FormInfoHelper::LoadStageFormConfigInfo(const BundleInfo &bundleInfo, st return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } - std::shared_ptr resourceManager = GetResourceManager(bundleInfo); - if (resourceManager == nullptr) { - HILOG_ERROR("InitResourceManager failed"); - return ERR_APPEXECFWK_FORM_COMMON_CODE; - } - + std::shared_ptr resourceManager = nullptr; for (auto const &extensionInfo: bundleInfo.extensionInfos) { if (extensionInfo.type != ExtensionAbilityType::FORM) { continue; @@ -105,6 +100,13 @@ ErrCode FormInfoHelper::LoadStageFormConfigInfo(const BundleInfo &bundleInfo, st if (!bundleInfo.applicationInfo.isSystemApp) { formInfo.transparencyEnabled = false; } + if (resourceManager == nullptr) { + resourceManager = GetResourceManager(bundleInfo); + } + if (resourceManager == nullptr) { + HILOG_ERROR("InitResourceManager failed"); + return ERR_APPEXECFWK_FORM_COMMON_CODE; + } if (GetFormInfoDisplayName(resourceManager, formInfo) != ERR_OK) { HILOG_INFO("Get FormInfo DisplayName fail"); } @@ -126,11 +128,7 @@ ErrCode FormInfoHelper::LoadAbilityFormConfigInfo(const BundleInfo &bundleInfo, HILOG_ERROR("failed to get IBundleMgr."); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } - std::shared_ptr resourceManager = GetResourceManager(bundleInfo); - if (resourceManager == nullptr) { - HILOG_ERROR("InitResourceManager failed"); - return ERR_APPEXECFWK_FORM_COMMON_CODE; - } + std::shared_ptr resourceManager = nullptr; const std::string &bundleName = bundleInfo.name; for (const auto &modelInfo: bundleInfo.hapModuleInfos) { const std::string &moduleName = modelInfo.moduleName; @@ -139,6 +137,13 @@ ErrCode FormInfoHelper::LoadAbilityFormConfigInfo(const BundleInfo &bundleInfo, continue; } for (auto &formInfo: formInfoVec) { + if (resourceManager == nullptr) { + resourceManager = GetResourceManager(bundleInfo); + } + if (resourceManager == nullptr) { + HILOG_ERROR("InitResourceManager failed"); + return ERR_APPEXECFWK_FORM_COMMON_CODE; + } if (GetFormInfoDescription(resourceManager, formInfo) != ERR_OK) { HILOG_INFO("Get FormInfo Description fail"); } @@ -819,6 +824,7 @@ ErrCode FormInfoMgr::ReloadFormInfos(const int32_t userId) HILOG_INFO("add forms info success, bundleName=%{public}s", bundleName.c_str()); } hasReloadedFormInfosState_ = true; + HILOG_INFO("ReloadFormInfos end, formInfoMapSize: %{public}zu", bundleFormInfoMap_.size()); return ERR_OK; } diff --git a/services/src/form_render_mgr.cpp b/services/src/form_render_mgr.cpp index e28947e029108090bbe2cf0f6d88ea5271859f4e..4e915237171d289494fb609c82b4a864d2446b37 100644 --- a/services/src/form_render_mgr.cpp +++ b/services/src/form_render_mgr.cpp @@ -102,7 +102,7 @@ ErrCode FormRenderMgr::RenderForm( ErrCode FormRenderMgr::UpdateRenderingForm(int64_t formId, const FormProviderData &formProviderData, const WantParams &wantParams, bool mergeData) { - HILOG_ERROR("UpdateRenderingForm with formId: %{public}" PRId64 "", formId); + HILOG_INFO("UpdateRenderingForm with formId: %{public}" PRId64 "", formId); FormRecord formRecord; bool isGetFormRecord = FormDataMgr::GetInstance().GetFormRecord(formId, formRecord); if (!isGetFormRecord) {