| CLASS info |
| public class FaceManager extends java.lang.Object |
| Represents the main entry for the BioAuthn 3D facial authentication API of HUAWEI FIDO. |
| 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 | 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 3D face data. |
| int | FACE_ERROR_LOCKOUT | The number of unlocking times reaches the maximum. |
| int | FACE_ERROR_VENDOR | Vendor-defined error. |
| 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 device does not have a 3D facial authentication sensor. |
| int | FACE_ERROR_VENDOR_BASE | Start result 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 | HMS Core framework error. |
| int | FACE_ERROR_VENDOR:1012 | The camera permission is disabled. |
| 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 because of 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 position is too far from the user device. |
| 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 high, and only the bottom 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 error. |
| int | FACE_ACQUIRED_VENDOR:1038 | A face is detected. |
| int | FACE_ACQUIRED_VENDOR:1012 | The face does not match. |
| 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 method.Value: 0 3D facial authentication is available. |
| Constant |
| public static final int FACE_ERROR_TIMEOUT |
Returned using the errorCode parameter in the onAuthError method of BioAuthnCallback when the auth method is called.Value: 3 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 3D face data. |
| Constant |
| public static final int FACE_ERROR_VENDOR |
Value: 8 Vendor-defined error. |
| Constant |
| public static final int FACE_ERROR_VENDOR_BASE |
Value: 1000 Start result code of vendor-defined errors. |
| Constant |
| public static final int FACE_ACQUIRED_VENDOR |
Returned using the helpCode parameter in the onAuthHelp method of BioAuthnCallback when the auth method is called.Value: 13 Vendor-defined error. |
| 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: Hardware is unavailable. FACE_ERROR_UNSUPPORTED_OS_VER: This version of operating system does not support 3D facial authentication. |
Parameters
| Parameter name | Parameter desc |
| crypto | Encryption object associated with this 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: 3D facial authentication hardware exists and is running properly. false: 3D facial authentication hardware does not exist or is running improperly. |
| Method |
| public boolean hasEnrolledTemplates() |
| Checks whether at least one 3D facial authentication template has been registered in the system. |
Return
| type | desc |
| boolean | true: At least one 3D facial authentication template has been registered in the system. false: No 3D facial authentication template has been registered in the system. |