public class FingerprintManager

extends Object

This class was deprecated in API level 28.

See BiometricPrompt which shows a system-provided dialog upon starting authentication. In a world where devices may have different types of biometric authentication, it's much more realistic to have a system-provided authentication dialog since the method may vary by vendor/device.

A class that coordinates access to the fingerprint hardware.

Requires the PackageManager#FEATURE_FINGERPRINT feature which can be detected using PackageManager.hasSystemFeature(String) .

Nested classes

class FingerprintManager.AuthenticationCallback This class was deprecated in API level 28. See BiometricPrompt.AuthenticationCallback

class FingerprintManager.AuthenticationResult This class was deprecated in API level 28. See BiometricPrompt.AuthenticationResult

class FingerprintManager.CryptoObject This class was deprecated in API level 28. See BiometricPrompt.CryptoObject

Constants int FINGERPRINT_ACQUIRED_GOOD The image acquired was good. int FINGERPRINT_ACQUIRED_IMAGER_DIRTY The fingerprint image was too noisy due to suspected or detected dirt on the sensor. int FINGERPRINT_ACQUIRED_INSUFFICIENT The fingerprint image was too noisy to process due to a detected condition (i.e. int FINGERPRINT_ACQUIRED_PARTIAL Only a partial fingerprint image was detected. int FINGERPRINT_ACQUIRED_TOO_FAST The fingerprint image was incomplete due to quick motion. int FINGERPRINT_ACQUIRED_TOO_SLOW The fingerprint image was unreadable due to lack of motion. int FINGERPRINT_ERROR_CANCELED The operation was canceled because the fingerprint sensor is unavailable. int FINGERPRINT_ERROR_HW_NOT_PRESENT The device does not have a fingerprint sensor. int FINGERPRINT_ERROR_HW_UNAVAILABLE The hardware is unavailable. int FINGERPRINT_ERROR_LOCKOUT The operation was canceled because the API is locked out due to too many attempts. int FINGERPRINT_ERROR_LOCKOUT_PERMANENT The operation was canceled because FINGERPRINT_ERROR_LOCKOUT occurred too many times. int FINGERPRINT_ERROR_NO_FINGERPRINTS The user does not have any fingerprints enrolled. int FINGERPRINT_ERROR_NO_SPACE Error state returned for operations like enrollment; the operation cannot be completed because there's not enough storage remaining to complete the operation. int FINGERPRINT_ERROR_TIMEOUT Error state returned when the current request has been running too long. int FINGERPRINT_ERROR_UNABLE_TO_PROCESS Error state returned when the sensor was unable to process the current image. int FINGERPRINT_ERROR_USER_CANCELED The user canceled the operation. int FINGERPRINT_ERROR_VENDOR Hardware vendors may extend this list if there are conditions that do not fall under one of the above categories.

Inherited methods java.lang.Object From class Object clone() Creates and returns a copy of this object. boolean equals(Object obj) Indicates whether some other object is "equal to" this one. void finalize() Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. final Class<?> getClass() Returns the runtime class of this Object . int hashCode() Returns a hash code value for the object. final void notify() Wakes up a single thread that is waiting on this object's monitor. final void notifyAll() Wakes up all threads that are waiting on this object's monitor. String toString() Returns a string representation of the object. final void wait(long timeout, int nanos) Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. final void wait(long timeout) Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed. final void wait() Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.

Constants

FINGERPRINT_ACQUIRED_GOOD public static final int FINGERPRINT_ACQUIRED_GOOD The image acquired was good. Constant Value: 0 (0x00000000)

FINGERPRINT_ACQUIRED_IMAGER_DIRTY public static final int FINGERPRINT_ACQUIRED_IMAGER_DIRTY The fingerprint image was too noisy due to suspected or detected dirt on the sensor. For example, it's reasonable return this after multiple FINGERPRINT_ACQUIRED_INSUFFICIENT or actual detection of dirt on the sensor (stuck pixels, swaths, etc.). The user is expected to take action to clean the sensor when this is returned. Constant Value: 3 (0x00000003)

FINGERPRINT_ACQUIRED_INSUFFICIENT public static final int FINGERPRINT_ACQUIRED_INSUFFICIENT The fingerprint image was too noisy to process due to a detected condition (i.e. dry skin) or a possibly dirty sensor (See FINGERPRINT_ACQUIRED_IMAGER_DIRTY ). Constant Value: 2 (0x00000002)

FINGERPRINT_ACQUIRED_PARTIAL public static final int FINGERPRINT_ACQUIRED_PARTIAL Only a partial fingerprint image was detected. During enrollment, the user should be informed on what needs to happen to resolve this problem, e.g. "press firmly on sensor." Constant Value: 1 (0x00000001)

FINGERPRINT_ACQUIRED_TOO_FAST public static final int FINGERPRINT_ACQUIRED_TOO_FAST The fingerprint image was incomplete due to quick motion. While mostly appropriate for linear array sensors, this could also happen if the finger was moved during acquisition. The user should be asked to move the finger slower (linear) or leave the finger on the sensor longer. Constant Value: 5 (0x00000005)

FINGERPRINT_ACQUIRED_TOO_SLOW public static final int FINGERPRINT_ACQUIRED_TOO_SLOW The fingerprint image was unreadable due to lack of motion. This is most appropriate for linear array sensors that require a swipe motion. Constant Value: 4 (0x00000004)

FINGERPRINT_ERROR_CANCELED public static final int FINGERPRINT_ERROR_CANCELED The operation was canceled because the fingerprint sensor is unavailable. For example, this may happen when the user is switched, the device is locked or another pending operation prevents or disables it. Constant Value: 5 (0x00000005)

FINGERPRINT_ERROR_HW_NOT_PRESENT public static final int FINGERPRINT_ERROR_HW_NOT_PRESENT The device does not have a fingerprint sensor. Constant Value: 12 (0x0000000c)

FINGERPRINT_ERROR_HW_UNAVAILABLE public static final int FINGERPRINT_ERROR_HW_UNAVAILABLE The hardware is unavailable. Try again later. Constant Value: 1 (0x00000001)

FINGERPRINT_ERROR_LOCKOUT public static final int FINGERPRINT_ERROR_LOCKOUT The operation was canceled because the API is locked out due to too many attempts. This occurs after 5 failed attempts, and lasts for 30 seconds. Constant Value: 7 (0x00000007)

FINGERPRINT_ERROR_LOCKOUT_PERMANENT public static final int FINGERPRINT_ERROR_LOCKOUT_PERMANENT The operation was canceled because FINGERPRINT_ERROR_LOCKOUT occurred too many times. Fingerprint authentication is disabled until the user unlocks with strong authentication (PIN/Pattern/Password) Constant Value: 9 (0x00000009)

FINGERPRINT_ERROR_NO_FINGERPRINTS public static final int FINGERPRINT_ERROR_NO_FINGERPRINTS The user does not have any fingerprints enrolled. Constant Value: 11 (0x0000000b)

FINGERPRINT_ERROR_NO_SPACE public static final int FINGERPRINT_ERROR_NO_SPACE Error state returned for operations like enrollment; the operation cannot be completed because there's not enough storage remaining to complete the operation. Constant Value: 4 (0x00000004)

FINGERPRINT_ERROR_TIMEOUT public static final int FINGERPRINT_ERROR_TIMEOUT Error state returned when the current request has been running too long. This is intended to prevent programs from waiting for the fingerprint sensor indefinitely. The timeout is platform and sensor-specific, but is generally on the order of 30 seconds. Constant Value: 3 (0x00000003)

FINGERPRINT_ERROR_UNABLE_TO_PROCESS public static final int FINGERPRINT_ERROR_UNABLE_TO_PROCESS Error state returned when the sensor was unable to process the current image. Constant Value: 2 (0x00000002)

FINGERPRINT_ERROR_USER_CANCELED public static final int FINGERPRINT_ERROR_USER_CANCELED The user canceled the operation. Upon receiving this, applications should use alternate authentication (e.g. a password). The application should also provide the means to return to fingerprint authentication, such as a "use fingerprint" button. Constant Value: 10 (0x0000000a)

FINGERPRINT_ERROR_VENDOR public static final int FINGERPRINT_ERROR_VENDOR Hardware vendors may extend this list if there are conditions that do not fall under one of the above categories. Vendors are responsible for providing error strings for these errors. These messages are typically reserved for internal operations such as enrollment, but may be used to express vendor errors not covered by the ones in fingerprint.h. Applications are expected to show the error message string if they happen, but are advised not to rely on the message id since they will be device and vendor-specific Constant Value: 8 (0x00000008)

Public methods

hasEnrolledFingerprints

Deprecated in Added in API level 23 Deprecated in API level 28 public boolean hasEnrolledFingerprints () This method was deprecated in API level 28.

See BiometricPrompt and FingerprintManager#FINGERPRINT_ERROR_NO_FINGERPRINTS Determine if there is at least one fingerprint enrolled.

Requires Manifest.permission.USE_FINGERPRINT Returns boolean true if at least one fingerprint is enrolled, false otherwise

isHardwareDetected

Deprecated in Added in API level 23 Deprecated in API level 28 public boolean isHardwareDetected () This method was deprecated in API level 28.

See BiometricPrompt and FingerprintManager#FINGERPRINT_ERROR_HW_UNAVAILABLE Determine if fingerprint hardware is present and functional.

Requires Manifest.permission.USE_FINGERPRINT Returns boolean true if hardware is present and functional, false otherwise.