Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

BiometricManager

open class BiometricManager
kotlin.Any
   ↳ androidx.biometric.BiometricManager

A class that provides system information related to biometrics (e.g. fingerprint, face, etc.).

On devices running Android 10 (API 29) and above, this will query the framework's version of android.hardware.biometrics.BiometricManager. On Android 9.0 (API 28) and prior versions, this will query androidx.core.hardware.fingerprint.FingerprintManagerCompat.

Summary

Constants
static Int

The hardware is unavailable.

static Int

The user does not have any biometrics enrolled.

static Int

There is no biometric hardware.

static Int

No error detected.

Public methods
open Int

Checks if the user can authenticate with biometrics.

open static BiometricManager
from(@NonNull context: Context)

Creates a BiometricManager instance from the given context.

Constants

BIOMETRIC_ERROR_HW_UNAVAILABLE

static val BIOMETRIC_ERROR_HW_UNAVAILABLE: Int

The hardware is unavailable. Try again later.

Value: android.hardware.biometrics.BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE

BIOMETRIC_ERROR_NONE_ENROLLED

static val BIOMETRIC_ERROR_NONE_ENROLLED: Int

The user does not have any biometrics enrolled.

Value: android.hardware.biometrics.BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED

BIOMETRIC_ERROR_NO_HARDWARE

static val BIOMETRIC_ERROR_NO_HARDWARE: Int

There is no biometric hardware.

Value: android.hardware.biometrics.BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE

BIOMETRIC_SUCCESS

static val BIOMETRIC_SUCCESS: Int

No error detected.

Value: android.hardware.biometrics.BiometricManager.BIOMETRIC_SUCCESS

Public methods

canAuthenticate

open fun canAuthenticate(): Int

Checks if the user can authenticate with biometrics. This requires at least one biometric sensor to be present, enrolled, and available on the device.

Return
Int BIOMETRIC_SUCCESS if the user can authenticate with biometrics. Otherwise, returns an error code indicating why the user cannot authenticate.

from

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

Creates a BiometricManager instance from the given context.

Return
BiometricManager An instance of BiometricManager.