!7021 优化代码检视意见处理

Merge pull request !7021 from jiangminsen/master001
This commit is contained in:
openharmony_ci 2024-09-20 01:17:46 +00:00 committed by Gitee
commit a48a534ccb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,7 @@ enum class GetExtensionAbilityInfoFlag {
GET_EXTENSION_ABILITY_INFO_WITH_METADATA = 0x00000004,
GET_EXTENSION_ABILITY_INFO_WITH_SKILL_URI = 0x00000008,
GET_EXTENSION_ABILITY_INFO_WITH_SKILL = 0x00000010,
// using this tag will only return one, only for c++
// using this tag will only return the first system app, only for c++
GET_EXTENSION_ABILITY_INFO_BY_TYPE_NAME = 0x00000020,
};

View File

@ -5688,7 +5688,7 @@ void BundleDataMgr::GetExtensionAbilityInfoByTypeName(uint32_t flags, int32_t us
if ((flags &
static_cast<uint32_t>(GetExtensionAbilityInfoFlag::GET_EXTENSION_ABILITY_INFO_BY_TYPE_NAME)) ==
static_cast<uint32_t>(GetExtensionAbilityInfoFlag::GET_EXTENSION_ABILITY_INFO_BY_TYPE_NAME)) {
if (item.second.GetInnerExtensionInfos().empty()) {
if (item.second.GetInnerExtensionInfos().empty() || !item.second.IsSystemApp()) {
continue;
}
bool ret = GetInnerBundleInfoWithFlags(item.first, flags, userId);

View File

@ -3706,6 +3706,7 @@ ErrCode BundleMgrHostImpl::QueryExtensionAbilityInfosOnlyWithTypeName(const std:
if ((flags &
static_cast<uint32_t>(GetExtensionAbilityInfoFlag::GET_EXTENSION_ABILITY_INFO_BY_TYPE_NAME)) ==
static_cast<uint32_t>(GetExtensionAbilityInfoFlag::GET_EXTENSION_ABILITY_INFO_BY_TYPE_NAME)) {
extensionInfos = infos;
return ret;
}
for_each(infos.begin(), infos.end(), [&typeName, &extensionInfos](const auto &info)->decltype(auto) {