Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efa47fd0 authored by Jigar Thakkar's avatar Jigar Thakkar
Browse files

Use allow_private_profile flag to guard private space API changes

Currently, the BiometricPrompt API setAllowBackgroundAuthentication is
guarded by the enableBiometricsToUnlockPrivateSpace feature flag. This
does not follow the pattern used by other private space API chagnes
wherein all the APIs are guarded by the allowPrivateProfile flag and the
implementation is guraded by both the allowPrivateProfile and the
individual feature flag. With this change, we move the
setAllowBackgroundAuthentication to use the allowPrivateProfile flag to
follow the same model used by other private sapce changes as mentioned
above.

Bug: 312184187
Test: atest CredentialInteractorImplTest
Change-Id: I8ce46920003956624809f201ba151fad16f3565b
parent fa03ad1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1551,7 +1551,7 @@ package android.hardware.biometrics {

  public static class BiometricPrompt.Builder {
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowBackgroundAuthentication(boolean);
    method @FlaggedApi("android.multiuser.enable_biometrics_to_unlock_private_space") @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowBackgroundAuthentication(boolean, boolean);
    method @FlaggedApi("android.os.allow_private_profile") @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowBackgroundAuthentication(boolean, boolean);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowedSensorIds(@NonNull java.util.List<java.lang.Integer>);
  }

+3 −3
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import static android.hardware.biometrics.BiometricManager.Authenticators;
import static android.hardware.biometrics.Flags.FLAG_ADD_KEY_AGREEMENT_CRYPTO_OBJECT;
import static android.hardware.biometrics.Flags.FLAG_CUSTOM_BIOMETRIC_PROMPT;
import static android.hardware.biometrics.Flags.FLAG_GET_OP_ID_CRYPTO_OBJECT;
import static android.multiuser.Flags.FLAG_ENABLE_BIOMETRICS_TO_UNLOCK_PRIVATE_SPACE;
import static android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE;

import android.annotation.CallbackExecutor;
import android.annotation.DrawableRes;
@@ -520,7 +520,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan

        /**
         * Remove {@link Builder#setAllowBackgroundAuthentication(boolean)} once
         * FLAG_ENABLE_BIOMETRICS_TO_UNLOCK_PRIVATE_SPACE is enabled.
         * FLAG_ALLOW_PRIVATE_PROFILE is enabled.
         *
         * @param allow If true, allows authentication when the calling package is not in the
         *              foreground. This is set to false by default.
@@ -529,7 +529,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
         * @return This builder
         * @hide
         */
        @FlaggedApi(FLAG_ENABLE_BIOMETRICS_TO_UNLOCK_PRIVATE_SPACE)
        @FlaggedApi(FLAG_ALLOW_PRIVATE_PROFILE)
        @TestApi
        @NonNull
        @RequiresPermission(anyOf = {TEST_BIOMETRIC, USE_BIOMETRIC_INTERNAL})