From 758712f4ce4030820f832dc82ccb9ffb5ce5fd04 Mon Sep 17 00:00:00 2001 From: wanghang Date: Sat, 29 Oct 2022 14:43:03 +0800 Subject: [PATCH] IssueNo:#I5YDJR Description:errCode opt Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wanghang Change-Id: Ifd7031da90580b00409207fcc7e167706997b642 --- .../appexecfwk_core/src/bundlemgr/bundle_mgr_proxy.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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 85cebafa54..555055d483 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 @@ -1919,6 +1919,10 @@ ErrCode BundleMgrProxy::IsAbilityEnabled(const AbilityInfo &abilityInfo, bool &i { HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); APP_LOGD("begin to IsAbilityEnabled of %{public}s", abilityInfo.name.c_str()); + if (abilityInfo.bundleName.empty() || abilityInfo.name.empty()) { + APP_LOGE("fail to IsAbilityEnabled due to params empty"); + return ERR_BUNDLE_MANAGER_PARAM_ERROR; + } MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { APP_LOGE("fail to IsAbilityEnabled due to write InterfaceToken fail"); @@ -1944,6 +1948,10 @@ ErrCode BundleMgrProxy::SetAbilityEnabled(const AbilityInfo &abilityInfo, bool i { HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); APP_LOGD("begin to SetAbilityEnabled of %{public}s", abilityInfo.name.c_str()); + if (abilityInfo.bundleName.empty() || abilityInfo.name.empty()) { + APP_LOGE("fail to SetAbilityEnabled due to params empty"); + return ERR_BUNDLE_MANAGER_PARAM_ERROR; + } MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { APP_LOGE("fail to SetAbilityEnabled due to write InterfaceToken fail"); -- Gitee