public enum BiometricError

  1. Object
  2. Enum<BiometricError>
  3. BiometricError

ImplementsComparable<BiometricError>

Typed error codes returned by Biometrics and SecureStorage when an asynchronous operation fails. Callers branch on these codes via BiometricException.getError() instead of string-matching error messages, which makes localization and recovery logic straightforward.

Enum constants

NOT_AVAILABLEBiometric hardware is not present, or is disabled by policy.
NOT_ENROLLEDHardware is present but the user has not enrolled any biometrics.
LOCKED_OUTToo many failed attempts; biometric prompt is temporarily disabled.
PERMANENTLY_LOCKED_OUTToo many failed attempts and the user must unlock with their device passcode or PIN before biometrics can be used again.
PASSCODE_NOT_SETThe device has no passcode / PIN / pattern configured.
USER_CANCELEDThe user explicitly cancelled the prompt.
SYSTEM_CANCELEDThe OS cancelled the prompt (app backgrounded, system pre-empted, etc.).
AUTHENTICATION_FAILEDAuthentication completed but the user was not recognized.
KEY_REVOKEDA previously-stored SecureStorage entry can no longer be decrypted because the user enrolled new biometrics or disabled device security since the entry was written.
UNKNOWNAnything not covered by the more specific codes.

Methods

public static BiometricError[] values()
public static BiometricError valueOf(String name)

Inherited methods

Enum constant details

NOT_AVAILABLE

NOT_AVAILABLE
Biometric hardware is not present, or is disabled by policy.

NOT_ENROLLED

NOT_ENROLLED
Hardware is present but the user has not enrolled any biometrics.

LOCKED_OUT

LOCKED_OUT
Too many failed attempts; biometric prompt is temporarily disabled.

PERMANENTLY_LOCKED_OUT

PERMANENTLY_LOCKED_OUT
Too many failed attempts and the user must unlock with their device passcode or PIN before biometrics can be used again.

PASSCODE_NOT_SET

PASSCODE_NOT_SET
The device has no passcode / PIN / pattern configured.

USER_CANCELED

USER_CANCELED
The user explicitly cancelled the prompt.

SYSTEM_CANCELED

SYSTEM_CANCELED
The OS cancelled the prompt (app backgrounded, system pre-empted, etc.).

AUTHENTICATION_FAILED

AUTHENTICATION_FAILED
Authentication completed but the user was not recognized.

KEY_REVOKED

KEY_REVOKED
A previously-stored SecureStorage entry can no longer be decrypted because the user enrolled new biometrics or disabled device security since the entry was written. Callers must re-prompt and re-write the entry.

UNKNOWN

UNKNOWN
Anything not covered by the more specific codes.

Method details

values

public static BiometricError[] values()

valueOf

public static BiometricError valueOf(String name)