FingerprintManagerCompat

open 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).

open

A wrapper class for the crypto objects supported by FingerprintManager.

Public methods

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

Request authentication of a crypto object.

open static FingerprintManagerCompat
from(@NonNull context: Context)

Get a FingerprintManagerCompat instance for a provided context.

open Boolean

Determine if there is at least one fingerprint enrolled.

open Boolean

Determine if fingerprint hardware is present and functional.

Public methods

authenticate

open 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 Int: optional flags; should be 0
cancel CancellationSignal?: an object that can be used to cancel authentication
callback FingerprintManagerCompat.AuthenticationCallback: an object to receive authentication events
handler Handler?: an optional handler for events

from

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

Get a FingerprintManagerCompat instance for a provided context.

hasEnrolledFingerprints

open 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

open fun isHardwareDetected(): Boolean

Determine if fingerprint hardware is present and functional.

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