FingerprintManagerCompat
open classFingerprintManagerCompat
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 |
Container for callback data from |
|
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 |
Get a |
open Boolean |
Determine if there is at least one fingerprint enrolled. |
open Boolean |
Determine if fingerprint hardware is present and functional. |
Public methods
authenticate
@RequiresPermission("android.permission.USE_FINGERPRINT") 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
@RequiresPermission("android.permission.USE_FINGERPRINT") 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 |