目录

AuthenticationCallback

Class Info

public static abstract class AuthenticationCallback

Facial recognition callback class, which is used for returning facial recognition results. Implement this abstract class.

Public Method Summary

Qualifier and Type

Method Name and Description

void

onAuthenticationError(int errorCode, CharSequence errString)

Callback for returning error messages during facial recognition.

void

onAuthenticationFailed()

Callback for failed facial recognition.

void

onAuthenticationHelp(int helpCode, CharSequence helpString)

Callback for prompt message during facial recognition.

void

onAuthenticationSucceeded(AuthenticationResult result)

Callback for successful facial recognition.

Public Methods

[h2]onAuthenticationError

Method

public void onAuthenticationError(int errorCode, CharSequence errString)

Callback for returning error messages during facial recognition.

Parameters

Name

Description

errorCode

Result code. For details, please refer to Result Codes.

errString

This is a prompt for error strings and can be displayed in UI.

[h2]onAuthenticationFailed

Method

public void onAuthenticationFailed()

Callback for failed facial recognition.

[h2]onAuthenticationHelp

Method

public void onAuthenticationHelp(int helpCode, CharSequence helpString)

Callback for prompt message during facial recognition.

Parameters

Name

Description

errorCode

The following are some possible prompts:

  • FACE_ACQUIRED_GOOD = 0: The obtained facial profile is acceptable.
  • FACE_ACQUIRED_INSUFFICIENT = 1: The obtained facial profile is insufficient for processing.
  • FACE_ACQUIRED_TOO_BRIGHT = 2: The obtained facial profile is too bright due to high illumination.
  • FACE_ACQUIRED_TOO_DARK = 3: The obtained facial profile is too dark due to low illumination.
  • FACE_ACQUIRED_TOO_CLOSE = 4: The device is too close to your face.
  • FACE_ACQUIRED_TOO_FAR = 5: The device is too far from your face.
  • FACE_ACQUIRED_TOO_HIGH = 6: The device position is too high, and only the top part of the face is obtained.
  • FACE_ACQUIRED_TOO_LOW = 7: The device position is too low, and only the lower part of the face is obtained.
  • FACE_ACQUIRED_TOO_RIGHT = 8: The device position is deviated to the right, and only the right part of the face is obtained.
  • FACE_ACQUIRED_TOO_LEFT = 9: The device position is deviated to the left, and only the left part of the face is obtained.
  • FACE_ACQUIRED_TOO_MUCH_MOTION = 10: The face moves too many times during facial profile collection.
  • FACE_ACQUIRED_POOR_GAZE = 11: The user's focus is too far away from the sensor, and an important part of the user's face is not obtained.
  • FACE_ACQUIRED_NOT_DETECTED = 12: The sensor detects no face.
  • FACE_ACQUIRED_VENDOR = 13: Extended information.

errString

This is a prompt message and can be displayed in UI.

[h2]onAuthenticationSucceeded

Method

public void onAuthenticationSucceeded(AuthenticationResult result)

Callback for successful facial recognition.

Parameters

Name

Description

result

Facial recognition result. For details, please refer to AuthenticationResult.