Register now for Android Dev Summit 2019!

FingerprintManagerCompat

class FingerprintManagerCompat
kotlin.Any
   ↳ androidx.core.hardware.fingerprint.FingerprintManagerCompat

A class that coordinates access to the fingerprint hardware.

On platforms before android.os.Build.VERSION_CODES#M, this class behaves as there would be no fingerprint hardware available.

Summary

Nested classes

abstract

Callback structure provided to FingerprintManagerCompat#authenticate(CryptoObject, * int, CancellationSignal, AuthenticationCallback, Handler).

Container for callback data from FingerprintManagerCompat#authenticate(CryptoObject, * int, CancellationSignal, AuthenticationCallback, Handler).

A wrapper class for the crypto objects supported by FingerprintManager.

Public methods

Unit
authenticate(@Nullable crypto: FingerprintManagerCompat.CryptoObject?, flags: Int, @Nullable cancel: CancellationSignal?, @NonNull callback: FingerprintManagerCompat.AuthenticationCallback, @Nullable handler: Handler?)

Request authentication of a crypto object.

static FingerprintManagerCompat
from(@NonNull context: Context)

Get a FingerprintManagerCompat instance for a provided context.

Boolean

Determine if there is at least one fingerprint enrolled.

Boolean

Determine if fingerprint hardware is present and functional.

Public methods

authenticate

fun authenticate(@Nullable crypto: FingerprintManagerCompat.CryptoObject?, flags: Int, @Nullable cancel: CancellationSignal?, @NonNull callback: FingerprintManagerCompat.AuthenticationCallback, @Nullable handler: Handler?): Unit

Request authentication of a crypto object. This call warms up the fingerprint hardware and starts scanning for a fingerprint. It terminates when AuthenticationCallback#onAuthenticationError(int, CharSequence) or AuthenticationCallback#onAuthenticationSucceeded(AuthenticationResult) is called, at which point the object is no longer valid. The operation can be canceled by using the provided cancel object.

Parameters
crypto FingerprintManagerCompat.CryptoObject?: object associated with the call or null if none required.
flags FingerprintManagerCompat.CryptoObject?: optional flags; should be 0
cancel FingerprintManagerCompat.CryptoObject?: an object that can be used to cancel authentication
callback FingerprintManagerCompat.CryptoObject?: an object to receive authentication events
handler FingerprintManagerCompat.CryptoObject?: an optional handler for events

from

@NonNull static fun from(@NonNull context: Context): FingerprintManagerCompat

Get a FingerprintManagerCompat instance for a provided context.

hasEnrolledFingerprints

fun hasEnrolledFingerprints(): Boolean

Determine if there is at least one fingerprint enrolled.

Return
Boolean: true if at least one fingerprint is enrolled, false otherwise

isHardwareDetected

fun isHardwareDetected(): Boolean

Determine if fingerprint hardware is present and functional.

Return
Boolean: true if hardware is present and functional, false otherwise.