Signed-off-by: liuziweicom <liuziwei12@huawei.com>
This commit is contained in:
liuziweicom 2024-03-05 18:41:48 +08:00
parent 0ba17e61c3
commit 641cd854f6
2 changed files with 3 additions and 15 deletions

View File

@ -490,32 +490,20 @@ int32_t UserAuthStub::GetEnrolledStateStub(MessageParcel &data, MessageParcel &r
{
IAM_LOGI("enter");
ON_SCOPE_EXIT(IAM_LOGI("leave"));
int32_t ret = GENERAL_ERROR;
int32_t apiVersion;
if (!data.ReadInt32(apiVersion)) {
IAM_LOGE("failed to read apiVersion");
static_cast<void>(reply.WriteInt32(ret));
return READ_PARCEL_ERROR;
}
int32_t authType;
if (!data.ReadInt32(authType)) {
static_cast<void>(reply.WriteInt32(ret));
IAM_LOGE("failed to read authType");
return READ_PARCEL_ERROR;
}
EnrolledState enrolledState = {};
int32_t result = GetEnrolledState(apiVersion, static_cast<AuthType>(authType), enrolledState);
if (result != SUCCESS) {
IAM_LOGE("failed to GetEnrolledState");
if (!reply.WriteInt32(result)) {
IAM_LOGE("failed to write ret");
return WRITE_PARCEL_ERROR;
}
return result;
}
ret = SUCCESS;
int32_t ret = GetEnrolledState(apiVersion, static_cast<AuthType>(authType), enrolledState);
if (!reply.WriteInt32(ret)) {
IAM_LOGE("failed to write ret");
return WRITE_PARCEL_ERROR;
@ -528,7 +516,7 @@ int32_t UserAuthStub::GetEnrolledStateStub(MessageParcel &data, MessageParcel &r
IAM_LOGE("failed to write credentialCount");
return WRITE_PARCEL_ERROR;
}
return result;
return SUCCESS;
}
} // namespace UserAuth
} // namespace UserIam

View File

@ -765,7 +765,7 @@ int32_t UserAuthService::RegisterWidgetCallback(int32_t version, sptr<WidgetCall
int32_t UserAuthService::GetEnrolledState(int32_t apiVersion, AuthType authType,
EnrolledState &enrolledState)
{
IAM_LOGE("start");
IAM_LOGI("start");
if (!IpcCommon::CheckPermission(*this, ACCESS_BIOMETRIC_PERMISSION)) {
IAM_LOGE("failed to check permission");