Add mandatory biometric prompt to platform surfaces (3/N)

Pass user ids for identity check. This is to make sure that the right
user is requested auth for different profiles.

Flag: android.hardware.biometrics.Flags.MANDATORY_BIOMETRICS
Bug: 339910718
Test: atest UtilsTest
Change-Id: I953b56e9bfd1edd49d080124905d42a23247b7a7
This commit is contained in:
Diya Bera
2024-07-22 21:52:36 +00:00
parent 51bb0fe4e4
commit 9bae71c15c
10 changed files with 79 additions and 44 deletions

View File

@@ -485,9 +485,11 @@ public class FingerprintSettings extends SubSettings {
mLaunchedConfirm = true;
launchChooseOrConfirmLock();
} else if (Utils.requestBiometricAuthenticationForMandatoryBiometrics(getActivity(),
mBiometricsSuccessfullyAuthenticated, mBiometricsAuthenticationRequested)) {
mBiometricsSuccessfullyAuthenticated, mBiometricsAuthenticationRequested,
mUserId)) {
mBiometricsAuthenticationRequested = true;
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST);
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST,
mUserId);
} else if (!mHasFirstEnrolled) {
mIsEnrolling = true;
addFirstFingerprint(null);
@@ -777,9 +779,11 @@ public class FingerprintSettings extends SubSettings {
.getUdfpsEnrollCalibrator(getActivity().getApplicationContext(), null, null);
if (Utils.requestBiometricAuthenticationForMandatoryBiometrics(getActivity(),
mBiometricsSuccessfullyAuthenticated, mBiometricsAuthenticationRequested)) {
mBiometricsSuccessfullyAuthenticated, mBiometricsAuthenticationRequested,
mUserId)) {
mBiometricsAuthenticationRequested = true;
Utils.launchBiometricPromptForMandatoryBiometrics(this, BIOMETRIC_AUTH_REQUEST);
Utils.launchBiometricPromptForMandatoryBiometrics(this,
BIOMETRIC_AUTH_REQUEST, mUserId);
}
}