From 9de920cb432d856aa13249eb86fc62da827b1a17 Mon Sep 17 00:00:00 2001 From: wanghang Date: Fri, 21 Oct 2022 10:51:56 +0800 Subject: [PATCH] IssueNo:#I5WWQT Description:fix errcode Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wanghang Change-Id: I9d460d92cb735c11f6a5c0ca7c9a05ea6f570a16 --- .../appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp | 4 ++-- interfaces/kits/js/bundle_manager/bundle_manager.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp index 98d2569f11..3948fcd01f 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp @@ -1206,7 +1206,7 @@ ErrCode BundleMgrProxy::GetAbilityLabel(const std::string &bundleName, const std APP_LOGI("begin to GetAbilityLabel of %{public}s", bundleName.c_str()); if (bundleName.empty() || moduleName.empty() || abilityName.empty()) { APP_LOGE("fail to GetAbilityLabel due to params empty"); - return ERR_BUNDLE_MANAGER_INVALID_PARAMETER; + return ERR_BUNDLE_MANAGER_PARAM_ERROR; } MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { @@ -3195,7 +3195,7 @@ ErrCode BundleMgrProxy::GetMediaData(const std::string &bundleName, const std::s APP_LOGD("begin to get media data of %{public}s, %{public}s", bundleName.c_str(), abilityName.c_str()); if (bundleName.empty() || abilityName.empty()) { APP_LOGE("fail to GetMediaData due to params empty"); - return ERR_APPEXECFWK_PARCEL_ERROR; + return ERR_BUNDLE_MANAGER_PARAM_ERROR; } MessageParcel data; diff --git a/interfaces/kits/js/bundle_manager/bundle_manager.cpp b/interfaces/kits/js/bundle_manager/bundle_manager.cpp index d02b69c9be..7ffd9abcfd 100644 --- a/interfaces/kits/js/bundle_manager/bundle_manager.cpp +++ b/interfaces/kits/js/bundle_manager/bundle_manager.cpp @@ -617,6 +617,10 @@ static ErrCode InnerGetAbilityIcon(const std::string &bundleName, const std::str APP_LOGE("CommonFunc::GetBundleMgr failed."); return ERROR_SYSTEM_ABILITY_NOT_FOUND; } + if (bundleName.empty() || moduleName.empty() || abilityName.empty()) { + APP_LOGE("GetAbilityIcon check param failed."); + return ERROR_PARAM_CHECK_ERROR; + } std::unique_ptr mediaDataPtr = nullptr; size_t len = 0; ErrCode ret = bundleMgr->GetMediaData(bundleName, moduleName, abilityName, mediaDataPtr, len); -- Gitee