BiometricManager
public
class
BiometricManager
extends Object
| java.lang.Object | |
| ↳ | android.hardware.biometrics.BiometricManager |
A class that contains biometric utilities. For authentication, see BiometricPrompt.
Summary
Constants | |
|---|---|
int |
BIOMETRIC_ERROR_HW_UNAVAILABLE
The hardware is unavailable. |
int |
BIOMETRIC_ERROR_NONE_ENROLLED
The user does not have any biometrics enrolled. |
int |
BIOMETRIC_ERROR_NO_HARDWARE
There is no biometric hardware. |
int |
BIOMETRIC_SUCCESS
No error detected. |
Public methods | |
|---|---|
int
|
canAuthenticate()
Determine if biometrics can be used. |
Inherited methods | |
|---|---|
Constants
BIOMETRIC_ERROR_HW_UNAVAILABLE
public static final int BIOMETRIC_ERROR_HW_UNAVAILABLE
The hardware is unavailable. Try again later.
Constant Value: 1 (0x00000001)
BIOMETRIC_ERROR_NONE_ENROLLED
public static final int BIOMETRIC_ERROR_NONE_ENROLLED
The user does not have any biometrics enrolled.
Constant Value: 11 (0x0000000b)
BIOMETRIC_ERROR_NO_HARDWARE
public static final int BIOMETRIC_ERROR_NO_HARDWARE
There is no biometric hardware.
Constant Value: 12 (0x0000000c)
BIOMETRIC_SUCCESS
public static final int BIOMETRIC_SUCCESS
No error detected.
Constant Value: 0 (0x00000000)
Public methods
canAuthenticate
public int canAuthenticate ()
Determine if biometrics can be used. In other words, determine if BiometricPrompt
can be expected to be shown (hardware available, templates enrolled, user-enabled).
Requires Manifest.permission.USE_BIOMETRIC
| Returns | |
|---|---|
int |
Returns BIOMETRIC_ERROR_NONE_ENROLLED if the user does not have any
enrolled, or BIOMETRIC_ERROR_HW_UNAVAILABLE if none are currently
supported/enabled. Returns BIOMETRIC_SUCCESS if a biometric can currently be
used (enrolled and available).
Value is BIOMETRIC_SUCCESS, BIOMETRIC_ERROR_HW_UNAVAILABLE, BIOMETRIC_ERROR_NONE_ENROLLED, or BIOMETRIC_ERROR_NO_HARDWARE |