| Type | Name | Desc |
| int | FACE_SUCCESS | 3D facial authentication is available. |
| int | FACE_ERROR_HW_UNAVAILABLE | Hardware is unavailable. Try again later. |
| int | FACE_ERROR_UNABLE_TO_PROCESS | The sensor cannot process the current face image. |
| int | FACE_ERROR_TIMEOUT | The request timed out. |
| int | FACE_ERROR_NO_SPACE | The storage space is insufficient for registration. |
| int | FACE_ERROR_CANCELED | The operation is canceled because the 3D facial authentication sensor is unavailable. |
| int | FACE_ERROR_UNABLE_TO_REMOVE | Failed to delete the facial data. |
| int | FACE_ERROR_LOCKOUT | The number of unlocking times reaches the maximum. |
| int | FACE_ERROR_VENDOR | Vendor-defined errors. |
| int | FACE_ERROR_LOCKOUT_PERMANENT | 3D facial authentication is disabled. |
| int | FACE_ERROR_USER_CANCELED | The user cancels the 3D facial authentication. |
| int | FACE_ERROR_NOT_ENROLLED | No 3D facial authentication template is registered before authentication. |
| int | FACE_ERROR_HW_NOT_PRESENT | The user device is not equipped with a facial sensor. |
| int | FACE_ERROR_VENDOR_BASE | Start error code of vendor-defined errors. |
| int | FACE_ERROR_SYS_INTEGRITY_FAILED | The device failed the system integrity check. |
| int | FACE_ERROR_UNSUPPORTED_OS_VER | This version of operating system does not support 3D facial authentication. |
| int | FACE_ERROR_HMS_FRAMEWORK_ERROR | HUAWEI HMS Framework error. |
| int | FACE_ERROR_VENDOR:1012 | Camera permission forbidden. |
| int | FACE_ACQUIRED_GOOD | The obtained face image is good. |
| int | FACE_ACQUIRED_INSUFFICIENT | The face image does not meet the processing requirements. |
| int | FACE_ACQUIRED_TOO_BRIGHT | The obtained face image is too bright due to high illumination. |
| int | FACE_ACQUIRED_TOO_DARK | The obtained face image is too dark due to low illumination. |
| int | FACE_ACQUIRED_TOO_CLOSE | The face position is too close to the user device. |
| int | FACE_ACQUIRED_TOO_FAR | The face is too far away. |
| int | FACE_ACQUIRED_TOO_HIGH | The user device position is too high, and only the top part of the face is obtained. |
| int | FACE_ACQUIRED_TOO_LOW | The user device position is too low, and only the lower part of the face is obtained. |
| int | FACE_ACQUIRED_TOO_RIGHT | The user device position is to the right, and only the right part of the face is obtained. |
| int | FACE_ACQUIRED_TOO_LEFT | The user device position is to the left, and only the left part of the face is obtained. |
| int | FACE_ACQUIRED_TOO_MUCH_MOTION | The face moves too many times during image collection. |
| int | FACE_ACQUIRED_POOR_GAZE | The user’s focus is too far away from the sensor, and an important part of the user’s face is hidden. |
| int | FACE_ACQUIRED_NOT_DETECTED | The sensor detects no face. |
| int | FACE_ACQUIRED_VENDOR | Vendor-defined errors. |
| int | 1012 | The face does not match.(BioAuthnCallback#onAuthHelp) |
| int | 1038 | The sensor detected face.(BioAuthnCallback#onAuthHelp) |
| int | 1012 | Camera permission forbidden.(BioAuthnCallback#onAuthError) |
| Method name |
FaceManager(android.content.Context context) Constructs a FaceManager object for 3D facial authentication, which is used to call the 3D facial authentication API of FIDO BioAuthn. |
| Return type | Method name |
| int | canAuth() Checks whether 3D facial authentication can be used, including checking whether the operating system version supports 3D facial authentication, whether hardware supports 3D facial authentication, and whether the 3D facial authentication template has been registered. |
| void | auth(final CryptoObject crypto, final android.os.CancellationSignal cancel, final int flags, final BioAuthnCallback callback, final android.os.Handler handler) Sends a 3D facial authentication request to the user device. |
| boolean | Checks whether 3D facial authentication hardware exists and is running properly. |
| boolean | Checks whether at least one 3D facial authentication template has been registered in the system. |
| Constant |
| public static final int FACE_SUCCESS |
Returned by the canAuth API; Value: 0 3D facial authentication is available. |
| Constant |
| public static final int FACE_ERROR_TIMEOUT |
Returned in the errorCode parameter sent by the onAuthError method of BioAuthnCallback when the auth method is called; Value: 3 The request timed out. |
| Constant |
| public static final int FACE_ERROR_NO_SPACE |
Value: 4 The storage space is insufficient for registration. |
| Constant |
| public static final int FACE_ERROR_UNABLE_TO_REMOVE |
Value: 6 Failed to delete the facial data. |
| Constant |
| public static final int FACE_ERROR_VENDOR |
Value: 8 Vendor-defined errors. |
| Constant |
| public static final int FACE_ERROR_VENDOR_BASE |
Value: 1000 Start error code of vendor-defined errors. |
| Error Code | description |
| 1012 | Returned in the errorCode parameter sent by the onAuthError method of BioAuthnCallback when the auth method is called; Value: 1012 Camera permission forbidden.(BioAuthnCallback#onAuthError) |
| 1038 | Returned in the helpCode parameter sent by the onAuthHelp method of BioAuthnCallback when the auth method is called; Value: 1038 The sensor detected face.(BioAuthnCallback#onAuthHelp) |
| 1012 | Returned in the helpCode parameter sent by the onAuthHelp method of BioAuthnCallback when the auth method is called; Value: 1012 The face does not match(BioAuthnCallback#onAuthHelp) |
| Method |
| public FaceManager(android.content.Context context) |
| Constructs a FaceManager object for 3D facial authentication, which is used to call the 3D facial authentication API of FIDO BioAuthn. |
Parameters
| Parameter name | Parameter desc |
| context | Context of an Android app. |
Return
| type | desc |
| int | FACE_SUCCESS 3D facial authentication is available (with faces registered and 3D facial authentication hardware available). FACE_ERROR_NOT_ENROLLED The 3D facial authentication template has not been registered before authentication. FACE_ERROR_HW_UNAVAILABLE The user device does not provide the 3D facial sensor. FACE_ERROR_UNSUPPORTED_OS_VER The operating system version does not support 3D facial authentication. |
Parameters
| Parameter name | Parameter desc |
| crypto | Cryptographic object associated with the authentication. The value can be null. |
| cancel | Cancellation signal object for canceling this authentication. The value can be null. |
| flags | Reserved. |
| callback | Callback. The value cannot be null. |
| handler | Object of the authentication-related message processor. The value can be null. |
| Method |
| public boolean isHardwareDetected() |
| Checks whether 3D facial authentication hardware exists and is running properly. |
Return
| type | desc |
| boolean | true: yes; false: no |
| Method |
| public boolean hasEnrolledTemplates() |
| Checks whether at least one 3D facial authentication template has been registered in the system. |
Return
| type | desc |
| boolean | true: yes; false: no |