Freigeben über


BiometricManager.CanAuthenticate Method

Definition

Overloads

CanAuthenticate()

Determine if biometrics can be used.

CanAuthenticate(Int32)

Determine if any of the provided authenticators can be used.

CanAuthenticate()

Determine if biometrics can be used.

[Android.Runtime.Register("canAuthenticate", "()I", "GetCanAuthenticateHandler", ApiSince=29)]
[Android.Runtime.RequiresPermission("android.permission.USE_BIOMETRIC")]
public virtual Android.Hardware.Biometrics.BiometricCode CanAuthenticate ();
[<Android.Runtime.Register("canAuthenticate", "()I", "GetCanAuthenticateHandler", ApiSince=29)>]
[<Android.Runtime.RequiresPermission("android.permission.USE_BIOMETRIC")>]
abstract member CanAuthenticate : unit -> Android.Hardware.Biometrics.BiometricCode
override this.CanAuthenticate : unit -> Android.Hardware.Biometrics.BiometricCode

Returns

#BIOMETRIC_ERROR_NONE_ENROLLED if the user does not have any strong biometrics enrolled, or #BIOMETRIC_ERROR_HW_UNAVAILABLE if none are currently supported/enabled. Returns #BIOMETRIC_SUCCESS if a strong biometric can currently be used (enrolled and available).

Attributes

Remarks

Determine if biometrics can be used. In other words, determine if BiometricPrompt can be expected to be shown (hardware available, templates enrolled, user-enabled). This is the equivalent of #canAuthenticate(int) with Authenticators#BIOMETRIC_WEAK

This member is deprecated. See #canAuthenticate(int).

Java documentation for android.hardware.biometrics.BiometricManager.canAuthenticate().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

CanAuthenticate(Int32)

Determine if any of the provided authenticators can be used.

[Android.Runtime.Register("canAuthenticate", "(I)I", "GetCanAuthenticate_IHandler", ApiSince=30)]
[Android.Runtime.RequiresPermission("android.permission.USE_BIOMETRIC")]
public virtual Android.Hardware.Biometrics.BiometricCode CanAuthenticate (int authenticators);
[<Android.Runtime.Register("canAuthenticate", "(I)I", "GetCanAuthenticate_IHandler", ApiSince=30)>]
[<Android.Runtime.RequiresPermission("android.permission.USE_BIOMETRIC")>]
abstract member CanAuthenticate : int -> Android.Hardware.Biometrics.BiometricCode
override this.CanAuthenticate : int -> Android.Hardware.Biometrics.BiometricCode

Parameters

authenticators
Int32

bit field consisting of constants defined in Authenticators. If multiple authenticators are queried, a logical OR will be applied. For example, if Authenticators#DEVICE_CREDENTIAL | Authenticators#BIOMETRIC_STRONG is queried and only Authenticators#DEVICE_CREDENTIAL is set up, this API will return #BIOMETRIC_SUCCESS

Returns

#BIOMETRIC_ERROR_NONE_ENROLLED if the user does not have any of the requested authenticators enrolled, or #BIOMETRIC_ERROR_HW_UNAVAILABLE if none are currently supported/enabled. Returns #BIOMETRIC_SUCCESS if one of the requested authenticators can currently be used (enrolled and available).

Attributes

Remarks

Determine if any of the provided authenticators can be used. In other words, determine if BiometricPrompt can be expected to be shown (hardware available, templates enrolled, user-enabled).

For biometric authenticators, determine if the device can currently authenticate with at least the requested strength. For example, invoking this API with Authenticators#BIOMETRIC_WEAK on a device that currently only has Authenticators#BIOMETRIC_STRONG enrolled will return #BIOMETRIC_SUCCESS.

Invoking this API with Authenticators#DEVICE_CREDENTIAL can be used to determine if the user has a PIN/Pattern/Password set up.

Java documentation for android.hardware.biometrics.BiometricManager.canAuthenticate(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to