[ Web Proxy ]
URL:
Viewing: https://source.android.com/docs/security/features/biometric#hal-implementation [Back]  [Original]

Biometrics  |  Android Open Source Project Skip to main content
Android Open Source Project [Android Open Source Project]

Biometrics Stay organized with collections Save and categorize content based on your preferences.

Biometrics offer a more convenient, but potentially less secure way of confirming your identity with a device. Under the tiered authentication model, primary authentication (that as, knowledge-factor based modalities such as PIN, pattern, and password) provides the highest level of security. Biometrics are in the secondary tier of authentication, offering a balance of convenience and security. The Android CDD defines three classes of biometric strength: Class 3 (formerly Strong), Class 2 (formerly Weak), and Class 1 (formerly Convenience). Each class has a set of prerequisites, privileges, and constraints - please see the CDD above for more details. All three classes are allowed to integrate with lockscreen, but only Strong and Weak authenticators are allowed to integrate with the android.hardware.biometrics APIs. This table describes each authenticator and the functionality they support.

Authenticator Lockscreen BiometricPrompt Integration Keystore (time-based key) Keystore (operation-based key)
BIOMETRIC_STRONG (Class 3) Yes Yes Yes Yes
BIOMETRIC_WEAK (Class 2) Yes Yes No No
BIOMETRIC_CONVENIENCE
(Class 1)
Yes No No No
DEVICE_CREDENTIAL Yes Yes Yes Yes

The Android framework includes support for face and fingerprint biometric authentication. Android can be customized to support other biometric modalities (such as Iris). However, biometric integration will depend on biometric security, not modality. For more details on biometric security specifications, see Measuring Biometric Unlock Security.

Source

Android 12

Android 11

Android 10

Android 9

Implementation

To ensure that users and developers have a seamless biometric experience, integrate your biometric stack with BiometricPrompt, BiometricManager, and ACTION_BIOMETRIC_ENROLL APIs. Devices with biometric sensors must adhere to these strength requirements.In addition, all implementations must pass the CtsBiometricsTestCases CTS module.

To integrate your biometric stack with the ACTION_BIOMETRIC_ENROLL API:

  1. Modify the BiometricEnrollActivity to present your enrollment flow. Note that your biometric can be presented only if it meets the requested strength. If your device supports more than one, this action should present a list the user can choose from.
BiometricPrompt architecture [BiometricPrompt architecture] Figure 1. BiometricPrompt architecture

HAL implementation guidelines

Follow these biometric HAL guidelines to ensure that biometric data is not leaked and is removed when a user is removed from a device:

Customization

If your device supports multiple biometrics, the user should be able to specify a default in settings. Your BiometricPrompt implementation should prefer the Class 3 (formerly Strong) biometric as the default unless the user explicitly overrides it, then a warning message needs to be displayed explaining the risks associated with the biometric (for example, A photo of you may unlock your device)

Device-specific authentication strings

Starting in Android 12, contextual authentication strings are made available to developers through the BiometricManager.Strings API. You may customize the resource values returned by this API to implement device-specific strings. If you do, ensure that any new strings are translated for all locales that the device supports. Additionally, make sure the following properties are preserved:


Method

String purpose

Authentication type(s) to include

If biometric(s) and screen lock are both possible

getButtonLabel()

Label for a button that triggers BiometricPrompt

Enrolled types only (if possible) that satisfy authenticator requirements

Use biometric-only string (such as, "Use fingerprint")

getPromptMessage()

Message shown on BiometricPrompt while authenticating

Enrolled types only (if possible) that satisfy authenticator requirements

Use combined biometric and screen lock string (e.g. "Use your fingerprint or PIN to continue")

getSettingName()

Name of a setting that enables BiometricPrompt for authentication

All types supported by the device (even if not enrolled) that satisfy authenticator requirements

Use combined biometric and screen lock string (such as, "Use fingerprint or screen lock")

For example, consider a device that has a Class 2 face sensor with an enrolled face, an enrolled PIN, and a Class 3 fingerprint sensor with no enrolled fingerprints. The following table provides sample strings for each combination of allowed authenticators and invoked BiometricManager.Strings method:


Allowed authenticators

getButtonLabel()

getPromptMessage()

getSettingName()

Class 3 biometric (BIOMETRIC_STRONG)

"Use fingerprint"
(Only fingerprint satisfies authenticator requirements)

"Use your fingerprint to continue"
(Only fingerprint satisfies authenticator requirements)

"Use fingerprint"
(Only fingerprint satisfies authenticator requirements)

Class 2 biometric (BIOMETRIC_WEAK)

"Use face"
(Face and fingerprint satisfy requirements; only face is enrolled)

"Use your face to continue"
(Face and fingerprint satisfy requirements; only face is enrolled)

"Use face or fingerprint"
(Face and fingerprint satisfy requirements; device supports both)

Screen lock (DEVICE_CREDENTIAL)

"Use PIN"
(Any screen lock satisfies requirements; PIN is enrolled)

"Enter your PIN to continue"
(Any screen lock satisfies requirements; PIN is enrolled)

"Use screen lock"
(Any screen lock satisfies requirements)

Class 3 biometric OR screen lock

"Use PIN"
(Fingerprint and any screen lock satisfy requirements; only PIN is enrolled)

"Enter your PIN to continue"
(Fingerprint and any screen lock satisfy requirements; only PIN is enrolled)

"Use fingerprint or screen lock"
(Fingerprint and any screen lock satisfy requirements)

Class 2 biometric OR screen lock

"Use face"
(Face, fingerprint, and any screen lock satisfy requirements; face is enrolled and supersedes PIN)

"Use your face or PIN to continue"
(Face, fingerprint, and any screen lock satisfy requirements; face and PIN are enrolled)

"Use biometrics or screen lock"
(Face, fingerprint, and any screen lock satisfy requirements)

Validation

Your biometric implementation must pass the following tests:

In addition, if your device supports a biometric that has an AOSP HIDL (fingerprint@2.1, fingerprint@2.2, face1.0), it must pass its relevant VTS test (fingerprint, face)

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-07-13 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-07-13 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page