diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_client_impl.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_client_impl.cpp index 72a1d7120324572bec41bb19c140d8fc2f84d1e5..77144b46103b198b4ebb120bc515c777c13f1e6c 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_client_impl.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_client_impl.cpp @@ -176,7 +176,7 @@ bool BundleMgrClientImpl::GetResConfigFile(const AbilityInfo &abilityInfo, const bool BundleMgrClientImpl::GetProfileFromExtension(const ExtensionAbilityInfo &extensionInfo, const std::string &metadataName, std::vector &profileInfos) const { - APP_LOGD("get extension config file from extension dir begin"); + APP_LOGD("begin"); bool isCompressed = !extensionInfo.hapPath.empty(); std::string resPath = isCompressed ? extensionInfo.hapPath : extensionInfo.resourcePath; if (!ConvertResourcePath(extensionInfo.bundleName, resPath, isCompressed)) { @@ -195,7 +195,7 @@ bool BundleMgrClientImpl::GetProfileFromExtension(const ExtensionAbilityInfo &ex bool BundleMgrClientImpl::GetProfileFromAbility(const AbilityInfo &abilityInfo, const std::string &metadataName, std::vector &profileInfos) const { - APP_LOGD("get ability config file from ability begin"); + APP_LOGD("begin"); bool isCompressed = !abilityInfo.hapPath.empty(); std::string resPath = isCompressed ? abilityInfo.hapPath : abilityInfo.resourcePath; if (!ConvertResourcePath(abilityInfo.bundleName, resPath, isCompressed)) { diff --git a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp index 33e756be1cf31ab665b722dec4258bce5156e2fb..bb525cacba0a8598d5fead91ca267d5f34574b4a 100644 --- a/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/bundlemgr/bundle_mgr_host.cpp @@ -97,11 +97,11 @@ BundleMgrHost::BundleMgrHost() int BundleMgrHost::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { BundleMemoryGuard memoryGuard; - APP_LOGD("bundle mgr host onReceived message, the message code is %{public}u", code); + APP_LOGD("message code:%{public}u", code); std::u16string descriptor = BundleMgrHost::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("fail to write reply message in bundle mgr host due to the reply is nullptr"); + APP_LOGE("descriptor != remoteDescriptor"); return OBJECT_NULL; } @@ -625,7 +625,7 @@ int BundleMgrHost::OnRemoteRequest(uint32_t code, MessageParcel &data, MessagePa APP_LOGW("bundleMgr host receives unknown code %{public}u", code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } - APP_LOGD("bundleMgr host finish to process message, errCode: %{public}d", errCode); + APP_LOGD("end, errCode: %{public}d", errCode); return (errCode == ERR_OK) ? NO_ERROR : UNKNOWN_ERROR; } 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 6fb523a5dd7a515723de1fd12441d1edf75c52a6..da7a5c2c82521355f43c8c2e78f30e6c39297133 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 @@ -456,15 +456,15 @@ ErrCode BundleMgrProxy::BatchGetBundleInfo(const std::vector &bundl ErrCode BundleMgrProxy::GetBundleInfoForSelf(int32_t flags, BundleInfo &bundleInfo) { HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); - LOG_D(BMS_TAG_QUERY, "begin to get bundle info for self"); + LOG_D(BMS_TAG_QUERY, "begin"); MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { - LOG_E(BMS_TAG_QUERY, "fail to GetBundleInfoForSelf due to write InterfaceToken fail"); + LOG_E(BMS_TAG_QUERY, "write interfaceToken failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt32(flags)) { - LOG_E(BMS_TAG_QUERY, "fail to GetBundleInfoForSelf due to write flag fail"); + LOG_E(BMS_TAG_QUERY, "write flag failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -474,6 +474,7 @@ ErrCode BundleMgrProxy::GetBundleInfoForSelf(int32_t flags, BundleInfo &bundleIn LOG_NOFUNC_E(BMS_TAG_QUERY, "GetBundleInfoForSelf failed err:%{public}d", res); return res; } + LOG_D(BMS_TAG_QUERY, "end"); return ERR_OK; } @@ -2129,33 +2130,35 @@ ErrCode BundleMgrProxy::IsCloneApplicationEnabled(const std::string &bundleName, ErrCode BundleMgrProxy::SetApplicationEnabled(const std::string &bundleName, bool isEnable, int32_t userId) { HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGD("begin to SetApplicationEnabled of %{public}s", bundleName.c_str()); + APP_LOGD("begin,bundleName:%{public}s", bundleName.c_str()); if (bundleName.empty()) { - APP_LOGE("fail to SetApplicationEnabled due to params empty"); + APP_LOGE("bundleName empty"); return ERR_BUNDLE_MANAGER_PARAM_ERROR; } MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { - APP_LOGE("fail to SetApplicationEnabled due to write InterfaceToken fail"); + APP_LOGE("write interfaceToken failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteString(bundleName)) { - APP_LOGE("fail to SetApplicationEnabled due to write bundleName fail"); + APP_LOGE("write bundleName failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteBool(isEnable)) { - APP_LOGE("fail to SetApplicationEnabled due to write isEnable fail"); + APP_LOGE("write isEnable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt32(userId)) { - APP_LOGE("fail to SetApplicationEnabled due to write userId fail"); + APP_LOGE("write userId failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } MessageParcel reply; if (!SendTransactCmd(BundleMgrInterfaceCode::SET_APPLICATION_ENABLED, data, reply)) { + APP_LOGE("send transact cmd failed"); return ERR_BUNDLE_MANAGER_IPC_TRANSACTION; } + APP_LOGD("end"); return reply.ReadInt32(); } @@ -2262,33 +2265,35 @@ ErrCode BundleMgrProxy::IsCloneAbilityEnabled(const AbilityInfo &abilityInfo, in ErrCode BundleMgrProxy::SetAbilityEnabled(const AbilityInfo &abilityInfo, bool isEnabled, int32_t userId) { HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGD("begin to SetAbilityEnabled of %{public}s", abilityInfo.name.c_str()); + APP_LOGD("begin,abilityInfo name:%{public}s", abilityInfo.name.c_str()); if (abilityInfo.bundleName.empty() || abilityInfo.name.empty()) { - APP_LOGE("fail to SetAbilityEnabled due to params empty"); + APP_LOGE("params empty"); return ERR_BUNDLE_MANAGER_PARAM_ERROR; } MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { - APP_LOGE("fail to SetAbilityEnabled due to write InterfaceToken fail"); + APP_LOGE("write interfaceToken failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&abilityInfo)) { - APP_LOGE("fail to SetAbilityEnabled due to write abilityInfo fail"); + APP_LOGE("write abilityInfo failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteBool(isEnabled)) { - APP_LOGE("fail to SetAbilityEnabled due to write isEnabled fail"); + APP_LOGE("write isEnable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt32(userId)) { - APP_LOGE("fail to SetAbilityEnabled due to write userId fail"); + APP_LOGE("write userId failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } MessageParcel reply; if (!SendTransactCmd(BundleMgrInterfaceCode::SET_ABILITY_ENABLED, data, reply)) { + APP_LOGE("send transact cmd failed"); return ERR_BUNDLE_MANAGER_IPC_TRANSACTION; } + APP_LOGD("end"); return reply.ReadInt32(); } diff --git a/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_host.cpp b/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_host.cpp index f23c1359ac89ecded7aa9a78cd4d5021c3f1f3d6..ffaa15a440428aca430c9c5011f7df81a478de56 100644 --- a/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_host.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_host.cpp @@ -41,7 +41,7 @@ int VerifyManagerHost::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { BundleMemoryGuard memoryGuard; - APP_LOGI("VerifyManagerHost OnRemoteRequest, message code : %{public}u", code); + APP_LOGI("message code : %{public}u", code); std::u16string descriptor = VerifyManagerHost::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { @@ -55,7 +55,7 @@ int VerifyManagerHost::OnRemoteRequest(uint32_t code, MessageParcel& data, case static_cast(VerifyManagerInterfaceCode::DELETE_ABC): return HandleDeleteAbc(data, reply); default: - APP_LOGW("VerifyManagerHost receive unknown code %{public}d", code); + APP_LOGW("unknown code:%{public}d", code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } } diff --git a/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_proxy.cpp b/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_proxy.cpp index 3ea13ab8969633a036e527ee8ffd3fc3d5e462c6..3db50bcdadb9754e526e0e308639b81546fec849 100644 --- a/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_proxy.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_proxy.cpp @@ -42,10 +42,10 @@ VerifyManagerProxy::~VerifyManagerProxy() ErrCode VerifyManagerProxy::Verify(const std::vector &abcPaths) { - APP_LOGI("begin to call Verify"); + APP_LOGI("begin"); HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); if (abcPaths.empty()) { - APP_LOGE("Verify failed due to params error"); + APP_LOGE("abcPaths emtpy"); return ERR_BUNDLE_MANAGER_VERIFY_PARAM_ERROR; } @@ -65,6 +65,7 @@ ErrCode VerifyManagerProxy::Verify(const std::vector &abcPaths) return ERR_BUNDLE_MANAGER_VERIFY_SEND_REQUEST_FAILED; } + APP_LOGD("end"); return reply.ReadInt32(); } @@ -88,10 +89,10 @@ ErrCode VerifyManagerProxy::RemoveFiles(const std::vector &abcPaths ErrCode VerifyManagerProxy::DeleteAbc(const std::string &path) { - APP_LOGI("begin to call DeleteAbc"); + APP_LOGI("begin"); HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); if (path.empty()) { - APP_LOGE("DeleteAbc failed due to params error"); + APP_LOGE("path empty"); return ERR_BUNDLE_MANAGER_DELETE_ABC_PARAM_ERROR; } @@ -111,6 +112,7 @@ ErrCode VerifyManagerProxy::DeleteAbc(const std::string &path) return ERR_BUNDLE_MANAGER_DELETE_ABC_SEND_REQUEST_FAILED; } + APP_LOGD("end"); return reply.ReadInt32(); } diff --git a/interfaces/kits/js/bundle_manager/bundle_manager.cpp b/interfaces/kits/js/bundle_manager/bundle_manager.cpp index 0bad64c017115754b3404a17d21e3a781a86d5bc..0fb4eda013981753ad83ce81d713081e07708bc1 100644 --- a/interfaces/kits/js/bundle_manager/bundle_manager.cpp +++ b/interfaces/kits/js/bundle_manager/bundle_manager.cpp @@ -2230,17 +2230,17 @@ void VerifyComplete(napi_env env, napi_status status, void *data) napi_value VerifyAbc(napi_env env, napi_callback_info info) { - APP_LOGD("napi call VerifyAbc called"); + APP_LOGD("begin"); NapiArg args(env, info); VerifyCallbackInfo *asyncCallbackInfo = new (std::nothrow) VerifyCallbackInfo(env); if (asyncCallbackInfo == nullptr) { - APP_LOGE("VerifyCallbackInfo asyncCallbackInfo is null"); + APP_LOGE("null asyncCallbackInfol"); return nullptr; } std::unique_ptr callbackPtr {asyncCallbackInfo}; if (!args.Init(ARGS_SIZE_TWO, ARGS_SIZE_THREE)) { - APP_LOGE("VerifyCallbackInfo napi func init failed"); + APP_LOGE("init failed"); BusinessError::ThrowTooFewParametersError(env, ERROR_PARAM_CHECK_ERROR); return nullptr; } @@ -2269,7 +2269,7 @@ napi_value VerifyAbc(napi_env env, napi_callback_info info) auto promise = CommonFunc::AsyncCallNativeMethod( env, asyncCallbackInfo, "VerifyAbc", VerifyExec, VerifyComplete); callbackPtr.release(); - APP_LOGD("napi call VerifyAbc done"); + APP_LOGD("end"); return promise; } @@ -2666,17 +2666,17 @@ void DeleteAbcComplete(napi_env env, napi_status status, void *data) napi_value DeleteAbc(napi_env env, napi_callback_info info) { - APP_LOGD("napi call DeleteAbc called"); + APP_LOGD("begin"); NapiArg args(env, info); VerifyCallbackInfo *asyncCallbackInfo = new (std::nothrow) VerifyCallbackInfo(env); if (asyncCallbackInfo == nullptr) { - APP_LOGE("VerifyCallbackInfo asyncCallbackInfo is null"); + APP_LOGE("null asyncCallbackInfo"); return nullptr; } std::unique_ptr callbackPtr {asyncCallbackInfo}; if (!args.Init(ARGS_SIZE_ONE, ARGS_SIZE_ONE)) { - APP_LOGE("VerifyCallbackInfo napi func init failed"); + APP_LOGE("init failed"); BusinessError::ThrowTooFewParametersError(env, ERROR_PARAM_CHECK_ERROR); return nullptr; } @@ -2690,7 +2690,7 @@ napi_value DeleteAbc(napi_env env, napi_callback_info info) auto promise = CommonFunc::AsyncCallNativeMethod( env, asyncCallbackInfo, "DeleteAbc", DeleteAbcExec, DeleteAbcComplete); callbackPtr.release(); - APP_LOGD("napi call DeleteAbc done"); + APP_LOGD("end"); return promise; } @@ -3021,13 +3021,13 @@ napi_value GetProfile(napi_env env, napi_callback_info info, const AbilityProfil napi_value GetProfileByAbility(napi_env env, napi_callback_info info) { - APP_LOGD("napi begin to GetProfileByAbility"); + APP_LOGD("begin"); return GetProfile(env, info, AbilityProfileType::ABILITY_PROFILE); } napi_value GetProfileByExAbility(napi_env env, napi_callback_info info) { - APP_LOGD("napi begin to GetProfileByExAbility"); + APP_LOGD("begin"); return GetProfile(env, info, AbilityProfileType::EXTENSION_PROFILE); } @@ -4030,11 +4030,11 @@ napi_value GetBundleInfos(napi_env env, napi_callback_info info) napi_value GetBundleInfoForSelf(napi_env env, napi_callback_info info) { - APP_LOGD("GetBundleInfoForSelf called"); + APP_LOGD("begin"); NapiArg args(env, info); BundleInfoCallbackInfo *asyncCallbackInfo = new (std::nothrow) BundleInfoCallbackInfo(env); if (asyncCallbackInfo == nullptr) { - APP_LOGE("asyncCallbackInfo is null"); + APP_LOGE("null asyncCallbackInfo"); return nullptr; } std::unique_ptr callbackPtr {asyncCallbackInfo}; @@ -4065,7 +4065,7 @@ napi_value GetBundleInfoForSelf(napi_env env, napi_callback_info info) auto promise = CommonFunc::AsyncCallNativeMethod( env, asyncCallbackInfo, "GetBundleInfoForSelf", GetBundleInfoForSelfExec, GetBundleInfoComplete); callbackPtr.release(); - APP_LOGD("call GetBundleInfoForSelf done"); + APP_LOGD("end"); return promise; } @@ -4633,7 +4633,7 @@ napi_value GetAdditionalInfo(napi_env env, napi_callback_info info) napi_value GetBundleInfoForSelfSync(napi_env env, napi_callback_info info) { - APP_LOGD("GetBundleInfoForSelfSync called"); + APP_LOGD("begin"); NapiArg args(env, info); if (!args.Init(ARGS_SIZE_ONE, ARGS_SIZE_ONE)) { APP_LOGE("param count invalid"); @@ -4680,6 +4680,7 @@ napi_value GetBundleInfoForSelfSync(napi_env env, napi_callback_info info) Query query(bundleName, GET_BUNDLE_INFO, flags, userId, env); CheckToCache(env, bundleInfo.uid, IPCSkeleton::GetCallingUid(), query, nBundleInfo); } + APP_LOGD("end"); return nBundleInfo; } diff --git a/interfaces/kits/js/bundle_manager/bundle_manager_sync.cpp b/interfaces/kits/js/bundle_manager/bundle_manager_sync.cpp index 09482372a00c5bdd0d96445f7a216549614a9bb6..3ea7e24c68a91824af18ce44217d915c270c8d69 100644 --- a/interfaces/kits/js/bundle_manager/bundle_manager_sync.cpp +++ b/interfaces/kits/js/bundle_manager/bundle_manager_sync.cpp @@ -809,7 +809,7 @@ ErrCode CheckAbilityFromBundleInfo(const BundleInfo& bundleInfo, const std::stri napi_value GetProfileByAbilitySync(napi_env env, napi_callback_info info) { - APP_LOGD("NAPI GetProfileByAbilitySync called"); + APP_LOGD("begin"); std::string moduleName; std::string abilityName; std::string metadataName; @@ -830,7 +830,7 @@ napi_value GetProfileByAbilitySync(napi_env env, napi_callback_info info) BundleInfo bundleInfo; ErrCode ret = CommonFunc::ConvertErrCode(iBundleMgr->GetBundleInfoForSelf(getAbilityFlag, bundleInfo)); if (ret != ERR_OK) { - APP_LOGE("GetProfileByAbilitySync failed"); + APP_LOGE("get bundleInfo for self failed"); napi_value businessError = BusinessError::CreateCommonError(env, ret, GET_PROFILE_BY_ABILITY_SYNC); napi_throw(env, businessError); return nullptr; @@ -838,7 +838,7 @@ napi_value GetProfileByAbilitySync(napi_env env, napi_callback_info info) AbilityInfo targetAbilityInfo; ret = CheckAbilityFromBundleInfo(bundleInfo, abilityName, moduleName, targetAbilityInfo); if (ret != ERR_OK) { - APP_LOGE("GetProfileByAbilitySync failed by CheckAbilityFromBundleInfo"); + APP_LOGE("check ability from bundleInfo failed"); napi_value businessError = BusinessError::CreateCommonError(env, ret, GET_PROFILE_BY_ABILITY_SYNC); napi_throw(env, businessError); return nullptr; @@ -846,7 +846,7 @@ napi_value GetProfileByAbilitySync(napi_env env, napi_callback_info info) BundleMgrClient client; std::vector profileVec; if (!client.GetProfileFromAbility(targetAbilityInfo, metadataName, profileVec)) { - APP_LOGE("GetProfileByAbilitySync failed by GetProfileFromAbility"); + APP_LOGE("get profile from ability failed"); napi_value businessError = BusinessError::CreateCommonError( env, ERROR_PROFILE_NOT_EXIST, GET_PROFILE_BY_ABILITY_SYNC); napi_throw(env, businessError); @@ -855,6 +855,7 @@ napi_value GetProfileByAbilitySync(napi_env env, napi_callback_info info) napi_value nProfileInfos = nullptr; NAPI_CALL(env, napi_create_array(env, &nProfileInfos)); CommonFunc::ConvertStringArrays(env, profileVec, nProfileInfos); + APP_LOGD("end"); return nProfileInfos; } @@ -878,15 +879,17 @@ ErrCode CheckExtensionFromBundleInfo(const BundleInfo& bundleInfo, const std::st napi_value GetProfileByExAbilitySync(napi_env env, napi_callback_info info) { - APP_LOGD("NAPI GetProfileByExAbilitySync called"); + APP_LOGD("begin"); std::string moduleName; std::string extensionAbilityName; std::string metadataName; if (ParamsProcessGetProfileByAbilitySync(env, info, moduleName, extensionAbilityName, metadataName) != ERR_OK) { + APP_LOGE("params process get profile by ability sync failed"); return nullptr; } auto iBundleMgr = CommonFunc::GetBundleMgr(); if (iBundleMgr == nullptr) { + APP_LOGE("null iBundleMgr"); napi_value error = BusinessError::CreateCommonError(env, ERROR_BUNDLE_SERVICE_EXCEPTION, GET_PROFILE_BY_EXTENSION_ABILITY_SYNC); napi_throw(env, error); @@ -900,7 +903,7 @@ napi_value GetProfileByExAbilitySync(napi_env env, napi_callback_info info) BundleInfo bundleInfo; ErrCode ret = CommonFunc::ConvertErrCode(iBundleMgr->GetBundleInfoForSelf(getExtensionFlag, bundleInfo)); if (ret != ERR_OK) { - APP_LOGE("GetProfileByExAbilitySync failed"); + APP_LOGE("get bundleInfo for self failed"); napi_value businessError = BusinessError::CreateCommonError(env, ret, GET_PROFILE_BY_EXTENSION_ABILITY_SYNC); napi_throw(env, businessError); return nullptr; @@ -908,7 +911,7 @@ napi_value GetProfileByExAbilitySync(napi_env env, napi_callback_info info) ExtensionAbilityInfo targetExtensionInfo; ret = CheckExtensionFromBundleInfo(bundleInfo, extensionAbilityName, moduleName, targetExtensionInfo); if (ret != ERR_OK) { - APP_LOGE("GetProfileByExAbilitySync failed by CheckExtensionFromBundleInfo"); + APP_LOGE("check extension from bundleInfo failed"); napi_value businessError = BusinessError::CreateCommonError(env, ret, GET_PROFILE_BY_EXTENSION_ABILITY_SYNC); napi_throw(env, businessError); return nullptr; @@ -916,7 +919,7 @@ napi_value GetProfileByExAbilitySync(napi_env env, napi_callback_info info) BundleMgrClient client; std::vector profileVec; if (!client.GetProfileFromExtension(targetExtensionInfo, metadataName, profileVec)) { - APP_LOGE("GetProfileByExAbilitySync failed by GetProfileFromExtension"); + APP_LOGE("get profile from extension failed"); napi_value businessError = BusinessError::CreateCommonError( env, ERROR_PROFILE_NOT_EXIST, GET_PROFILE_BY_EXTENSION_ABILITY_SYNC); napi_throw(env, businessError); diff --git a/services/bundlemgr/src/bundle_data_mgr.cpp b/services/bundlemgr/src/bundle_data_mgr.cpp index 89fd3436b2ebc832abb6d73af7de4994dc7f5d21..30bd905e7929a962807c2cc1319132f4f2e9971c 100644 --- a/services/bundlemgr/src/bundle_data_mgr.cpp +++ b/services/bundlemgr/src/bundle_data_mgr.cpp @@ -2720,6 +2720,8 @@ bool BundleDataMgr::GetBundleInfo( ErrCode BundleDataMgr::GetBundleInfoV9( const std::string &bundleName, int32_t flags, BundleInfo &bundleInfo, int32_t userId, int32_t appIndex) const { + LOG_D(BMS_TAG_QUERY, "begin,bundleName:%{public}s,userId:%{public}d,appIndex:%{public}d", + bundleName.c_str(), userId, appIndex); HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); if (userId == Constants::ANY_USERID) { @@ -2733,6 +2735,7 @@ ErrCode BundleDataMgr::GetBundleInfoV9( int32_t requestUserId = GetUserId(userId); if (requestUserId == Constants::INVALID_USERID) { + LOG_E(BMS_TAG_QUERY, "invalid userId"); return ERR_BUNDLE_MANAGER_INVALID_USER_ID; } @@ -2743,7 +2746,7 @@ ErrCode BundleDataMgr::GetBundleInfoV9( auto ret = GetInnerBundleInfoWithBundleFlagsV9(bundleName, flags, innerBundleInfo, requestUserId); if (ret != ERR_OK) { - LOG_D(BMS_TAG_QUERY, "GetBundleInfoV9 failed, error code: %{public}d, bundleName:%{public}s", + LOG_E(BMS_TAG_QUERY, "GetBundleInfoV9 failed, error code: %{public}d, bundleName:%{public}s", ret, bundleName.c_str()); return ret; } @@ -3488,19 +3491,21 @@ bool BundleDataMgr::GetBundleNameForUid(const int32_t uid, std::string &bundleNa ErrCode BundleDataMgr::GetBundleNameAndIndexForUid(const int32_t uid, std::string &bundleName, int32_t &appIndex) const { + APP_LOGD("begin,uid:%{public}d,bundleName:%{public}s,appIndex:%{public}d", uid, bundleName.c_str(), appIndex); InnerBundleInfo innerBundleInfo; if (GetInnerBundleInfoAndIndexByUid(uid, innerBundleInfo, appIndex) != ERR_OK) { if (sandboxAppHelper_ == nullptr) { + APP_LOGE("null sandboxAppHelper_"); return ERR_BUNDLE_MANAGER_INVALID_UID; } if (sandboxAppHelper_->GetInnerBundleInfoByUid(uid, innerBundleInfo) != ERR_OK) { + APP_LOGE("get innerBundleInfo by uid failed"); return ERR_BUNDLE_MANAGER_INVALID_UID; } } bundleName = innerBundleInfo.GetBundleName(); - APP_LOGD("GetBundleNameForUid, uid %{public}d, bundleName %{public}s, appIndex %{public}d", - uid, bundleName.c_str(), appIndex); + APP_LOGD("end"); return ERR_OK; } @@ -4305,11 +4310,11 @@ ErrCode BundleDataMgr::IsApplicationEnabled( ErrCode BundleDataMgr::SetApplicationEnabled(const std::string &bundleName, int32_t appIndex, bool isEnable, const std::string &caller, int32_t userId) { - APP_LOGD("SetApplicationEnabled %{public}s", bundleName.c_str()); + APP_LOGD("begin, bundleName: %{public}s", bundleName.c_str()); std::unique_lock lock(bundleInfoMutex_); int32_t requestUserId = GetUserId(userId); if (requestUserId == Constants::INVALID_USERID) { - APP_LOGW("Request userId %{public}d is invalid, bundleName:%{public}s", userId, bundleName.c_str()); + APP_LOGW("requestUserId %{public}d is invalid, bundleName:%{public}s", userId, bundleName.c_str()); return ERR_BUNDLE_MANAGER_BUNDLE_NOT_EXIST; } auto infoItem = bundleInfos_.find(bundleName); @@ -4349,6 +4354,7 @@ ErrCode BundleDataMgr::SetApplicationEnabled(const std::string &bundleName, bundleStateStorage_->SaveBundleStateStorage( bundleName, requestUserId, innerBundleUserInfo.bundleUserInfo); } + APP_LOGD("end"); return ERR_OK; } @@ -4446,7 +4452,7 @@ ErrCode BundleDataMgr::SetAbilityEnabled(const AbilityInfo &abilityInfo, int32_t std::unique_lock lock(bundleInfoMutex_); int32_t requestUserId = GetUserId(userId); if (requestUserId == Constants::INVALID_USERID) { - APP_LOGW("Request userId is invalid, bundleName:%{public}s, abilityName:%{public}s", + APP_LOGW("requestUserId is invalid, bundleName:%{public}s, abilityName:%{public}s", abilityInfo.bundleName.c_str(), abilityInfo.name.c_str()); return ERR_BUNDLE_MANAGER_BUNDLE_NOT_EXIST; } @@ -4460,7 +4466,8 @@ ErrCode BundleDataMgr::SetAbilityEnabled(const AbilityInfo &abilityInfo, int32_t auto ret = newInfo.SetCloneAbilityEnabled( abilityInfo.moduleName, abilityInfo.name, isEnabled, userId, appIndex); if (ret != ERR_OK) { - APP_LOGW("SetCloneAbilityEnabled failed result: %{public}d, bundleName:%{public}s, abilityName:%{public}s", + APP_LOGW( + "set clone ability enabled failed result: %{public}d, bundleName:%{public}s, abilityName:%{public}s", ret, abilityInfo.bundleName.c_str(), abilityInfo.name.c_str()); return ret; } @@ -4473,7 +4480,7 @@ ErrCode BundleDataMgr::SetAbilityEnabled(const AbilityInfo &abilityInfo, int32_t ErrCode ret = newInfo.SetAbilityEnabled( abilityInfo.moduleName, abilityInfo.name, isEnabled, userId); if (ret != ERR_OK) { - APP_LOGW("SetAbilityEnabled failed result: %{public}d, bundleName:%{public}s, abilityName:%{public}s", + APP_LOGW("set ability enabled failed result: %{public}d, bundleName:%{public}s, abilityName:%{public}s", ret, abilityInfo.bundleName.c_str(), abilityInfo.name.c_str()); return ret; } diff --git a/services/bundlemgr/src/bundle_mgr_host_impl.cpp b/services/bundlemgr/src/bundle_mgr_host_impl.cpp index a9ceb39966a9675cb7ae135ceafac2f5ce2b9e66..48fe75eaf55b7c9e7b9c31eaf7f03b9c5efeb327 100644 --- a/services/bundlemgr/src/bundle_mgr_host_impl.cpp +++ b/services/bundlemgr/src/bundle_mgr_host_impl.cpp @@ -310,6 +310,7 @@ ErrCode BundleMgrHostImpl::BatchGetBundleInfo(const std::vector &bu ErrCode BundleMgrHostImpl::GetBundleInfoForSelf(int32_t flags, BundleInfo &bundleInfo) { + LOG_D(BMS_TAG_QUERY, "begin"); HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__); int32_t timerId = XCollieHelper::SetRecoveryTimer(FUNCATION_GET_BUNDLE_INFO_FOR_SELF); ScopeGuard cancelTimerIdGuard([timerId] { XCollieHelper::CancelTimer(timerId); }); @@ -318,7 +319,7 @@ ErrCode BundleMgrHostImpl::GetBundleInfoForSelf(int32_t flags, BundleInfo &bundl std::string bundleName; auto dataMgr = GetDataMgrFromService(); if (dataMgr == nullptr) { - LOG_E(BMS_TAG_QUERY, "DataMgr is nullptr"); + LOG_E(BMS_TAG_QUERY, "null dataMgr"); return ERR_BUNDLE_MANAGER_INTERNAL_ERROR; } int32_t appIndex = 0; @@ -2189,7 +2190,7 @@ ErrCode BundleMgrHostImpl::SetApplicationEnabled(const std::string &bundleName, } auto dataMgr = GetDataMgrFromService(); if (dataMgr == nullptr) { - APP_LOGE("DataMgr is nullptr"); + APP_LOGE("null dataMgr"); EventReport::SendComponentStateSysEventForException(bundleName, "", userId, isEnable, 0, caller); return ERR_APPEXECFWK_SERVICE_NOT_READY; } @@ -2219,6 +2220,7 @@ ErrCode BundleMgrHostImpl::SetApplicationEnabled(const std::string &bundleName, std::shared_ptr commonEventMgr = std::make_shared(); commonEventMgr->NotifyBundleStatus(installRes, dataMgr); IPCSkeleton::SetCallingIdentity(identity); + APP_LOGD("end"); return ERR_OK; } diff --git a/services/bundlemgr/src/bundle_state_storage.cpp b/services/bundlemgr/src/bundle_state_storage.cpp index 47c715453e7247c2955bf2badc3a7027d959ead7..f7656825035a16c857947b8d2a2c03b5578629fe 100644 --- a/services/bundlemgr/src/bundle_state_storage.cpp +++ b/services/bundlemgr/src/bundle_state_storage.cpp @@ -149,9 +149,9 @@ bool BundleStateStorage::LoadAllBundleStateDataFromJson( bool BundleStateStorage::SaveBundleStateStorage( const std::string bundleName, int32_t userId, const BundleUserInfo &bundleUserInfo) { - APP_LOGD("Save bundle state to json db"); + APP_LOGD("begin"); if (bundleName.empty() || userId < 0) { - APP_LOGE("Save bundle state failed due to param invalid"); + APP_LOGE("param invalid"); return false; } @@ -177,6 +177,7 @@ bool BundleStateStorage::SaveBundleStateStorage( o << std::setw(Constants::DUMP_INDENT) << rootJson; } o.close(); + APP_LOGD("end"); return true; } @@ -209,9 +210,9 @@ bool BundleStateStorage::GetBundleStateStorage( bool BundleStateStorage::DeleteBundleState( const std::string bundleName, int32_t userId) { - APP_LOGD("Delete bundle state data"); + APP_LOGD("begin"); if (bundleName.empty() || userId < 0) { - APP_LOGE("Delete bundle state data failed due to param invalid"); + APP_LOGE("param invalid"); return false; } std::lock_guard lock(bundleStateMutex_); @@ -238,6 +239,7 @@ bool BundleStateStorage::DeleteBundleState( o << std::setw(Constants::DUMP_INDENT) << jParse; } o.close(); + APP_LOGD("end"); return true; } diff --git a/services/bundlemgr/src/rdb/rdb_data_manager.cpp b/services/bundlemgr/src/rdb/rdb_data_manager.cpp index 505c30364203457b50ce8df01f88bd5c7ca3bf25..598c29e99720296355621d74e1911ee05e8edaff 100644 --- a/services/bundlemgr/src/rdb/rdb_data_manager.cpp +++ b/services/bundlemgr/src/rdb/rdb_data_manager.cpp @@ -150,10 +150,10 @@ void RdbDataManager::BackupRdb() bool RdbDataManager::InsertData(const std::string &key, const std::string &value) { - APP_LOGD("InsertData start"); + APP_LOGD("begin"); auto rdbStore = GetRdbStore(); if (rdbStore == nullptr) { - APP_LOGE("RdbStore is null"); + APP_LOGE("null rdbStore"); return false; } @@ -162,6 +162,7 @@ bool RdbDataManager::InsertData(const std::string &key, const std::string &value valuesBucket.PutString(BMS_KEY, key); valuesBucket.PutString(BMS_VALUE, value); auto ret = InsertWithRetry(rdbStore, rowId, valuesBucket); + APP_LOGD("end,ret:%{public}d", ret); return ret == NativeRdb::E_OK; } diff --git a/services/bundlemgr/src/sandbox_app/bundle_sandbox_data_mgr.cpp b/services/bundlemgr/src/sandbox_app/bundle_sandbox_data_mgr.cpp index 6ed95d6c7711d3c22ab26c77653a579acca008e2..4004fb8b0bb003c6d720d4963eee5bcbc7e662aa 100644 --- a/services/bundlemgr/src/sandbox_app/bundle_sandbox_data_mgr.cpp +++ b/services/bundlemgr/src/sandbox_app/bundle_sandbox_data_mgr.cpp @@ -238,13 +238,13 @@ ErrCode BundleSandboxDataMgr::GetSandboxHapModuleInfo(const AbilityInfo &ability ErrCode BundleSandboxDataMgr::GetInnerBundleInfoByUid(const int32_t &uid, InnerBundleInfo &innerBundleInfo) const { - APP_LOGD("GetInnerBundleInfoByUid with uid is %{public}d", uid); + APP_LOGD("begin,uid is %{public}d", uid); if (uid < Constants::BASE_APP_UID) { APP_LOGD("the uid(%{public}d) is not an application", uid); return ERR_APPEXECFWK_SANDBOX_QUERY_NO_SANDBOX_APP; } int32_t userId = BundleUtil::GetUserIdByUid(uid); - APP_LOGD("GetInnerBundleInfoByUid with userId is %{public}d", userId); + APP_LOGD("userId is %{public}d", userId); { std::shared_lock lock(sandboxAppMutex_); @@ -252,7 +252,7 @@ ErrCode BundleSandboxDataMgr::GetInnerBundleInfoByUid(const int32_t &uid, InnerB for (const auto &item : sandboxAppInfos_) { const InnerBundleInfo &info = item.second; auto innerUid = info.GetUid(userId); - APP_LOGD("GetInnerBundleInfoByUid with innerUid is %{public}d", innerUid); + APP_LOGD("innerUid is %{public}d", innerUid); if (innerUid == uid) { innerBundleInfo = info; return ERR_OK; @@ -260,6 +260,7 @@ ErrCode BundleSandboxDataMgr::GetInnerBundleInfoByUid(const int32_t &uid, InnerB } } } + APP_LOGE("sandboxQuery no sandboxApp"); return ERR_APPEXECFWK_SANDBOX_QUERY_NO_SANDBOX_APP; } diff --git a/services/bundlemgr/src/verify/verify_manager_host_impl.cpp b/services/bundlemgr/src/verify/verify_manager_host_impl.cpp index 85619afcaee08afe78ffc2cf6e7fd8c70405a6c2..c10185a889b29d9dd3b0a556fb859cd648c64746 100644 --- a/services/bundlemgr/src/verify/verify_manager_host_impl.cpp +++ b/services/bundlemgr/src/verify/verify_manager_host_impl.cpp @@ -144,6 +144,7 @@ VerifyManagerHostImpl::~VerifyManagerHostImpl() ErrCode VerifyManagerHostImpl::Verify(const std::vector &abcPaths) { + APP_LOGD("begin"); if (!BundlePermissionMgr::IsSystemApp() && !BundlePermissionMgr::VerifyCallingBundleSdkVersion(ServiceConstants::API_VERSION_TWELVE)) { APP_LOGE("non-system app calling system api"); @@ -177,6 +178,7 @@ ErrCode VerifyManagerHostImpl::Verify(const std::vector &abcPaths) ErrCode ret = InnerVerify(bundleName, abcPaths); RemoveTempFiles(bundleName); + APP_LOGD("end,ret:%{public}d", ret); return ret; } @@ -431,6 +433,7 @@ bool VerifyManagerHostImpl::MoveAbc( const std::string &bundleName, const std::vector &abcPaths) { + APP_LOGD("begin"); auto rootDir = GetRootDir(bundleName); auto tempRootDir = GetTempRootDir(bundleName); std::vector hasMovePaths; @@ -462,6 +465,7 @@ bool VerifyManagerHostImpl::MoveAbc( hasMovePaths.emplace_back(targetPath); } + APP_LOGD("end"); return true; } @@ -488,6 +492,7 @@ void VerifyManagerHostImpl::Rollback(const std::vector &paths) ErrCode VerifyManagerHostImpl::DeleteAbc(const std::string &path) { + APP_LOGD("begin"); if (!BundlePermissionMgr::IsSystemApp() && !BundlePermissionMgr::VerifyCallingBundleSdkVersion(ServiceConstants::API_VERSION_TWELVE)) { APP_LOGE("non-system app calling system api"); @@ -495,26 +500,26 @@ ErrCode VerifyManagerHostImpl::DeleteAbc(const std::string &path) } if (!BundlePermissionMgr::VerifyCallingPermissionForAll(Constants::PERMISSION_RUN_DYN_CODE)) { - APP_LOGE("DeleteAbc failed due to permission denied"); + APP_LOGE("permission denied"); return ERR_BUNDLE_MANAGER_VERIFY_PERMISSION_DENIED; } if (!IsValidPath(path)) { - APP_LOGE("DeleteAbc failed due to invalid path"); + APP_LOGE("invalid path"); return ERR_BUNDLE_MANAGER_DELETE_ABC_PARAM_ERROR; } if (!BundleUtil::CheckFileType(path, ABC_FILE_SUFFIX)) { - APP_LOGE("DeleteAbc failed due to not abc file"); + APP_LOGE("check file type filed"); return ERR_BUNDLE_MANAGER_DELETE_ABC_PARAM_ERROR; } auto dataMgr = DelayedSingleton::GetInstance()->GetDataMgr(); if (dataMgr == nullptr) { - APP_LOGE("DeleteAbc failed due to dataMgr is null"); + APP_LOGE("null dataMgr"); return ERR_BUNDLE_MANAGER_DELETE_ABC_FAILED; } int32_t callingUid = IPCSkeleton::GetCallingUid(); InnerBundleInfo innerBundleInfo; if (dataMgr->GetInnerBundleInfoByUid(callingUid, innerBundleInfo) != ERR_OK) { - APP_LOGE("DeleteAbc failed due to get callingUid failed"); + APP_LOGE("get callingUid failed"); return ERR_BUNDLE_MANAGER_DELETE_ABC_FAILED; } @@ -527,20 +532,19 @@ ErrCode VerifyManagerHostImpl::DeleteAbc(const std::string &path) bool isExist = false; auto result = InstalldClient::GetInstance()->IsExistFile(realPath, isExist); if (result != ERR_OK) { - APP_LOGE("DeleteAbc %{public}s failed due to call IsExistFile failed %{public}d", - realPath.c_str(), result); + APP_LOGE("%{public}s call IsExistFile failed %{public}d", realPath.c_str(), result); return ERR_BUNDLE_MANAGER_DELETE_ABC_FAILED; } if (!isExist) { - APP_LOGE("DeleteAbc failed due to path %{public}s is not exist", realPath.c_str()); + APP_LOGE("path %{public}s not exist", realPath.c_str()); return ERR_BUNDLE_MANAGER_DELETE_ABC_FAILED; } result = InstalldClient::GetInstance()->RemoveDir(realPath); if (result != ERR_OK) { - APP_LOGE("DeleteAbc failed due to remove path %{public}s failed %{public}d", - realPath.c_str(), result); + APP_LOGE("remove path %{public}s failed %{public}d", realPath.c_str(), result); return ERR_BUNDLE_MANAGER_DELETE_ABC_FAILED; } + APP_LOGD("end"); return ERR_OK; }