!7055 AddPermissionUsedRecord增加返回值校验

Merge pull request !7055 from xuyicong/fix_addpermissionusedrecord
This commit is contained in:
openharmony_ci 2024-09-24 03:51:24 +00:00 committed by Gitee
commit 253d21d355
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -587,7 +587,11 @@ void BundlePermissionMgr::AddPermissionUsedRecord(
AccessToken::AccessTokenID callerToken = IPCSkeleton::GetCallingTokenID();
AccessToken::ATokenTypeEnum tokenType = AccessToken::AccessTokenKit::GetTokenTypeFlag(callerToken);
if (tokenType == AccessToken::ATokenTypeEnum::TOKEN_HAP) {
AccessToken::PrivacyKit::AddPermissionUsedRecord(callerToken, permission, successCount, failCount);
int32_t ret = AccessToken::PrivacyKit::AddPermissionUsedRecord(callerToken, permission,
successCount, failCount);
if (ret != AccessToken::AccessTokenKitRet::RET_SUCCESS) {
APP_LOGE("AddPermissionUsedRecord failed, ret = %{public}d", ret);
}
}
}