!84 codex问题修复

Merge pull request !84 from 韩震/baiweiW
This commit is contained in:
openharmony_ci
2022-03-16 03:25:04 +00:00
committed by Gitee
3 changed files with 18 additions and 10 deletions
+3 -3
View File
@@ -98,7 +98,7 @@ int32_t AddCredential(std::vector<uint8_t> enrollToken, uint64_t &credentialId)
GlobalUnLock();
return RESULT_BAD_COPY;
}
int32_t ret = AddCredentialFunc(enrollTokenIn, (uint32_t)sizeof(ScheduleTokenHal), &credentialId);
int32_t ret = AddCredentialFunc(enrollTokenIn, static_cast<uint32_t>(sizeof(ScheduleTokenHal)), &credentialId);
GlobalUnLock();
return ret;
}
@@ -274,8 +274,8 @@ int32_t UpdateCredential(std::vector<uint8_t> enrollToken, uint64_t &credentialI
return RESULT_BAD_COPY;
}
CredentialInfoHal credentialInfoHal;
int32_t ret =
UpdateCredentialFunc(enrollTokenIn, (uint32_t)sizeof(ScheduleTokenHal), &credentialId, &credentialInfoHal);
int32_t ret = UpdateCredentialFunc(enrollTokenIn, static_cast<uint32_t>(sizeof(ScheduleTokenHal)),
&credentialId, &credentialInfoHal);
if (ret != RESULT_SUCCESS) {
LOG_ERROR("update failed");
GlobalUnLock();
+1 -1
View File
@@ -31,7 +31,7 @@ public:
private:
std::string pkgName_;
int32_t callerUid_;
uint64_t callerUid_;
};
} // namespace CoAuth
} // namespace UserIAM
+14 -6
View File
@@ -70,6 +70,7 @@ void CoAuthManager::CoAuthHandle(uint64_t scheduleId, AuthInfo &authInfo, sptr<I
void CoAuthManager::BeginExecute(ScheduleInfo &scheduleInfo, std::size_t executorNum, uint64_t scheduleId,
AuthInfo &authInfo, int32_t &executeRet)
{
executeRet = SUCCESS;
for (std::size_t i = 0; i < executorNum; i++) {
uint32_t authType = scheduleInfo.executors[i].authType;
COAUTH_HILOGD(MODULE_SERVICE, "get authType = %{public}u", authType);
@@ -83,7 +84,11 @@ void CoAuthManager::BeginExecute(ScheduleInfo &scheduleInfo, std::size_t executo
}
auto commandAttrs = std::make_shared<ResAuthAttributes>();
SetAuthAttributes(commandAttrs, scheduleInfo, authInfo);
executeRet |= executorCallback->OnBeginExecute(scheduleId, publicKey, commandAttrs);
int32_t ret = executorCallback->OnBeginExecute(scheduleId, publicKey, commandAttrs);
if (ret != SUCCESS) {
COAUTH_HILOGE(MODULE_SERVICE, "executor i = %{public}zu failed", i);
executeRet = ret;
}
}
}
@@ -128,8 +133,8 @@ int32_t CoAuthManager::Cancel(uint64_t scheduleId)
uint32_t authType = scheduleInfo.executors[i].authType;
sptr<ResIExecutorCallback> executorCallback;
COAUTH_HILOGD(MODULE_SERVICE, "get exeID = %{public}u", authType);
int32_t findRet = coAuthResMgrPtr_->FindExecutorCallback(authType, executorCallback);
if ((findRet != 0) || (executorCallback == nullptr)) {
int32_t onceRet = coAuthResMgrPtr_->FindExecutorCallback(authType, executorCallback);
if ((onceRet != 0) || (executorCallback == nullptr)) {
COAUTH_HILOGE(MODULE_SERVICE, "executor callback not found.");
continue;
}
@@ -137,7 +142,11 @@ int32_t CoAuthManager::Cancel(uint64_t scheduleId)
commandAttrs->SetUint32Value(AUTH_SCHEDULE_MODE, scheduleInfo.scheduleMode);
commandAttrs->SetUint64Value(AUTH_SUBTYPE, scheduleInfo.authSubType);
commandAttrs->SetUint64Value(AUTH_TEMPLATE_ID, scheduleInfo.templateId);
executeRet |= executorCallback->OnEndExecute(scheduleId, commandAttrs);
onceRet = executorCallback->OnEndExecute(scheduleId, commandAttrs);
if (onceRet != SUCCESS) {
COAUTH_HILOGE(MODULE_SERVICE, "executor i = %{public}zu failed", i);
executeRet = onceRet;
}
}
if (executeRet != SUCCESS) {
COAUTH_HILOGW(MODULE_SERVICE, "There are one or more failures when canceling.");
@@ -178,11 +187,10 @@ void CoAuthManager::SetExecutorProp(ResAuthAttributes &conditions, sptr<ISetProp
std::shared_ptr<ResAuthAttributes> properties = std::make_shared<ResAuthAttributes>();
conditions.Pack(buffer);
properties->Unpack(buffer);
result = execallback->OnSetProperty(properties);
result = static_cast<uint32_t>(execallback->OnSetProperty(properties));
if (result != SUCCESS) {
COAUTH_HILOGE(MODULE_SERVICE, "set properties failure");
}
COAUTH_HILOGI(MODULE_SERVICE, "set properties successfull");
callback->OnResult(result, extraInfo);
}