FingerprintManagerCompat

Added in 1.1.0
Deprecated in 1.1.0

public class FingerprintManagerCompat


A class that coordinates access to the fingerprint hardware.

On platforms before M, this class behaves as there would be no fingerprint hardware available.

Summary

Nested types

Callback structure provided to authenticate.

Container for callback data from authenticate.

A wrapper class for the crypto objects supported by FingerprintManager.

Public methods

void
@RequiresPermission(value = Manifest.permission.USE_FINGERPRINT)
authenticate(
    @Nullable FingerprintManagerCompat.CryptoObject crypto,
    int flags,
    @Nullable CancellationSignal cancel,
    @NonNull FingerprintManagerCompat.AuthenticationCallback callback,
    @Nullable Handler handler
)

Request authentication of a crypto object.

void
@RequiresPermission(value = Manifest.permission.USE_FINGERPRINT)
authenticate(
    @Nullable FingerprintManagerCompat.CryptoObject crypto,
    int flags,
    @Nullable CancellationSignal cancel,
    @NonNull FingerprintManagerCompat.AuthenticationCallback callback,
    @Nullable Handler handler
)

This method is deprecated.

Use authenticate

static @NonNull FingerprintManagerCompat
from(@NonNull Context context)

Get a FingerprintManagerCompat instance for a provided context.

boolean
@RequiresPermission(value = Manifest.permission.USE_FINGERPRINT)
hasEnrolledFingerprints()

Determine if there is at least one fingerprint enrolled.

boolean
@RequiresPermission(value = Manifest.permission.USE_FINGERPRINT)
isHardwareDetected()

Determine if fingerprint hardware is present and functional.

Public methods

authenticate

Deprecated in 1.13.0-alpha05
@RequiresPermission(value = Manifest.permission.USE_FINGERPRINT)
public void authenticate(
    @Nullable FingerprintManagerCompat.CryptoObject crypto,
    int flags,
    @Nullable CancellationSignal cancel,
    @NonNull FingerprintManagerCompat.AuthenticationCallback callback,
    @Nullable Handler handler
)

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

Parameters
@Nullable FingerprintManagerCompat.CryptoObject crypto

object associated with the call or null if none required.

int flags

optional flags; should be 0

@Nullable CancellationSignal cancel

an object that can be used to cancel authentication

@NonNull FingerprintManagerCompat.AuthenticationCallback callback

an object to receive authentication events

@Nullable Handler handler

an optional handler for events

authenticate

Added in 1.1.0
Deprecated in 1.1.0
@RequiresPermission(value = Manifest.permission.USE_FINGERPRINT)
public void authenticate(
    @Nullable FingerprintManagerCompat.CryptoObject crypto,
    int flags,
    @Nullable CancellationSignal cancel,
    @NonNull FingerprintManagerCompat.AuthenticationCallback callback,
    @Nullable Handler handler
)

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

Parameters
@Nullable FingerprintManagerCompat.CryptoObject crypto

object associated with the call or null if none required.

int flags

optional flags; should be 0

@Nullable CancellationSignal cancel

an object that can be used to cancel authentication

@NonNull FingerprintManagerCompat.AuthenticationCallback callback

an object to receive authentication events

@Nullable Handler handler

an optional handler for events

from

Added in 1.1.0
Deprecated in 1.1.0
public static @NonNull FingerprintManagerCompat from(@NonNull Context context)

Get a FingerprintManagerCompat instance for a provided context.

hasEnrolledFingerprints

Added in 1.1.0
Deprecated in 1.1.0
@RequiresPermission(value = Manifest.permission.USE_FINGERPRINT)
public boolean hasEnrolledFingerprints()

Determine if there is at least one fingerprint enrolled.

Returns
boolean

true if at least one fingerprint is enrolled, false otherwise

isHardwareDetected

Added in 1.1.0
Deprecated in 1.1.0
@RequiresPermission(value = Manifest.permission.USE_FINGERPRINT)
public boolean isHardwareDetected()

Determine if fingerprint hardware is present and functional.

Returns
boolean

true if hardware is present and functional, false otherwise.