Signed-off-by: wangyang2022 <wangyang412@huawei.com>

修改 Code Check 代码规范性问题
This commit is contained in:
wangyang2022 2022-04-29 22:00:06 +08:00
parent de2d75915f
commit 093750455d
4 changed files with 9 additions and 8 deletions

View File

@ -64,7 +64,7 @@ private:
const CallerInfo& callerInfo, const AccountInfo& accountInfo, const AAFwk::Want& want) const;
bool CheckCustomPermission(const AppExecFwk::AbilityInfo& targetAbility,
const CallerInfo& callerInfo) const;
bool getTargetAbility(const AAFwk::Want& want, bool needQueryExtension, const std::string& localDeviceId,
bool getTargetAbility(const AAFwk::Want& want, bool needQueryExtension, const std::string& localDeviceId,
AppExecFwk::AbilityInfo& targetAbility, const CallerInfo& callerInfo) const;
};
} // namespace DistributedSchedule

View File

@ -111,7 +111,8 @@ bool BundleManagerInternal::QueryAbilityInfo(const AAFwk::Want& want, AppExecFwk
return true;
}
bool BundleManagerInternal::QueryExtensionAbilityInfo(const AAFwk::Want& want, AppExecFwk::ExtensionAbilityInfo& extensionInfo)
bool BundleManagerInternal::QueryExtensionAbilityInfo(const AAFwk::Want& want,
AppExecFwk::ExtensionAbilityInfo& extensionInfo)
{
std::vector<int> ids;
int32_t ret = OsAccountManager::QueryActiveOsAccountIds(ids);
@ -133,10 +134,9 @@ bool BundleManagerInternal::QueryExtensionAbilityInfo(const AAFwk::Want& want, A
extensionInfo = extensionInfos.front();
if (extensionInfo.bundleName.empty() || extensionInfo.name.empty()) {
HILOGE("ExtensionAbilityInfo is empty.");
return false;
return false;
}
HILOGD("ExtensionAbilityInfo found, name=%{public}s.",
extensionInfo.name.c_str());
HILOGD("ExtensionAbilityInfo found, name=%{public}s.", extensionInfo.name.c_str());
return true;
}

View File

@ -162,11 +162,11 @@ bool DistributedSchedPermission::getTargetAbility(const AAFwk::Want& want,
if (BundleManagerInternal::QueryAbilityInfo(want, targetAbility)) {
return true;
}
if(needQueryExtension){
if (needQueryExtension) {
HILOGI("QueryAbilityInfo failed, try to QueryExtensionAbilityInfo");
// try to find extension
AppExecFwk::ExtensionAbilityInfo extensionAbility;
if(BundleManagerInternal::QueryExtensionAbilityInfo(want, extensionAbility)){
if (BundleManagerInternal::QueryExtensionAbilityInfo(want, extensionAbility)) {
// extensionAbilityInfo translates to abilityInfo
BundleManagerInternal::InitAbilityInfoFromExtension(extensionAbility, targetAbility);
return true;

View File

@ -923,7 +923,8 @@ int32_t DistributedSchedService::ConnectAbilityFromRemote(const OHOS::AAFwk::Wan
DistributedSchedPermission& permissionInstance = DistributedSchedPermission::GetInstance();
bool needQueryExtension = true;
int32_t result = permissionInstance.CheckDPermission(want, callerInfo, accountInfo, needQueryExtension, localDeviceId);
int32_t result = permissionInstance.CheckDPermission(want, callerInfo, accountInfo,
needQueryExtension, localDeviceId);
if (result != ERR_OK) {
HILOGE("ConnectAbilityFromRemote CheckDPermission denied!!");
return result;