1 /*
2  * Copyright 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.credentials.provider
18 
19 import androidx.annotation.IntDef
20 import androidx.annotation.RestrictTo
21 import androidx.biometric.BiometricPrompt
22 import androidx.biometric.BiometricPrompt.ERROR_CANCELED
23 import androidx.biometric.BiometricPrompt.ERROR_HW_NOT_PRESENT
24 import androidx.biometric.BiometricPrompt.ERROR_HW_UNAVAILABLE
25 import androidx.biometric.BiometricPrompt.ERROR_LOCKOUT
26 import androidx.biometric.BiometricPrompt.ERROR_LOCKOUT_PERMANENT
27 import androidx.biometric.BiometricPrompt.ERROR_NO_BIOMETRICS
28 import androidx.biometric.BiometricPrompt.ERROR_NO_DEVICE_CREDENTIAL
29 import androidx.biometric.BiometricPrompt.ERROR_NO_SPACE
30 import androidx.biometric.BiometricPrompt.ERROR_SECURITY_UPDATE_REQUIRED
31 import androidx.biometric.BiometricPrompt.ERROR_TIMEOUT
32 import androidx.biometric.BiometricPrompt.ERROR_UNABLE_TO_PROCESS
33 import androidx.biometric.BiometricPrompt.ERROR_USER_CANCELED
34 import androidx.biometric.BiometricPrompt.ERROR_VENDOR
35 
36 /**
37  * This acts as a parameter hint for what [BiometricPrompt]'s error constants should be. You can
38  * learn more about the constants from [BiometricPrompt] to utilize best practices.
39  *
40  * @see BiometricPrompt
41  */
42 @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.TYPE)
43 @Retention(AnnotationRetention.SOURCE)
44 @IntDef(
45     value =
46         [
47             ERROR_CANCELED,
48             ERROR_HW_NOT_PRESENT,
49             ERROR_HW_UNAVAILABLE,
50             ERROR_LOCKOUT,
51             ERROR_LOCKOUT_PERMANENT,
52             ERROR_NO_BIOMETRICS,
53             ERROR_NO_DEVICE_CREDENTIAL,
54             ERROR_NO_SPACE,
55             ERROR_SECURITY_UPDATE_REQUIRED,
56             ERROR_TIMEOUT,
57             ERROR_UNABLE_TO_PROCESS,
58             ERROR_USER_CANCELED,
59             ERROR_VENDOR
60         ]
61 )
62 @RestrictTo(RestrictTo.Scope.LIBRARY)
63 annotation class AuthenticationErrorTypes
64