1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef FACE_AUTH_DEFINES_H
17#define FACE_AUTH_DEFINES_H
18
19#include <cstdint>
20
21namespace OHOS {
22namespace UserIam {
23namespace FaceAuth {
24enum FaceAuthRet : int32_t {
25    FACE_AUTH_SUCCESS = 0,
26    FACE_AUTH_ERROR = 1,
27    FACE_AUTH_CHECK_PERMISSION_FAILED = 201,
28    FACE_AUTH_CHECK_SYSTEM_PERMISSION_FAILED = 202,
29};
30
31enum ResultCode {
32    /**
33     * Indicates that authentication is success or ability is supported.
34     */
35    SUCCESS = 0,
36    /**
37     * Indicates the authenticator fails to identify user.
38     */
39    FAIL = 1,
40    /**
41     * Indicates other errors.
42     */
43    GENERAL_ERROR = 2,
44    /**
45     * Indicates that authentication has been canceled.
46     */
47    CANCELED = 3,
48    /**
49     * Indicates that authentication has timed out.
50     */
51    TIMEOUT = 4,
52    /**
53     * Indicates that this authentication type is not supported.
54     */
55    TYPE_NOT_SUPPORT = 5,
56    /**
57     * Indicates that the authentication trust level is not supported.
58     */
59    TRUST_LEVEL_NOT_SUPPORT = 6,
60    /**
61     * Indicates that the authentication task is busy. Wait for a few seconds and try again.
62     */
63    BUSY = 7,
64    /**
65     * Indicates incorrect parameters.
66     */
67    INVALID_PARAMETERS = 8,
68    /**
69     * Indicates that the authenticator is locked.
70     */
71    LOCKED = 9,
72    /**
73     * Indicates that the user has not enrolled the authenticator.
74     */
75    NOT_ENROLLED = 10,
76    /**
77     * Indicates that the operation is not supported.
78     */
79    OPERATION_NOT_SUPPORT = 11,
80    /**
81     * Vendor may add result code after this.
82     */
83    VENDOR_RESULT_CODE_BEGIN = 10000
84};
85} // namespace FaceAuth
86} // namespace UserIam
87} // namespace OHOS
88#endif // FACE_AUTH_DEFINES_H
89