mirror of
https://gitee.com/openharmony/useriam_user_auth_framework
synced 2024-11-27 09:50:45 +00:00
fix code
Signed-off-by: liuziweicom <liuziwei12@huawei.com>
This commit is contained in:
parent
0ba17e61c3
commit
641cd854f6
@ -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
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user