Merge "Disable APP_ARCHIVING flag for specific test" into main
diff --git a/src/com/android/settings/password/BiometricFragment.java b/src/com/android/settings/password/BiometricFragment.java
index 379ce80..90a1feb 100644
--- a/src/com/android/settings/password/BiometricFragment.java
+++ b/src/com/android/settings/password/BiometricFragment.java
@@ -21,6 +21,7 @@
 import android.hardware.biometrics.BiometricPrompt.AuthenticationCallback;
 import android.hardware.biometrics.BiometricPrompt.AuthenticationResult;
 import android.hardware.biometrics.PromptInfo;
+import android.multiuser.Flags;
 import android.os.Bundle;
 import android.os.CancellationSignal;
 
@@ -140,8 +141,14 @@
                 .setDisallowBiometricsIfPolicyExists(
                         promptInfo.isDisallowBiometricsIfPolicyExists())
                 .setShowEmergencyCallButton(promptInfo.isShowEmergencyCallButton())
-                .setReceiveSystemEvents(true)
-                .setAllowBackgroundAuthentication(true);
+                .setReceiveSystemEvents(true);
+
+        if (Flags.enableBiometricsToUnlockPrivateSpace()) {
+            promptBuilder = promptBuilder.setAllowBackgroundAuthentication(true /* allow */,
+                    promptInfo.shouldUseParentProfileForDeviceCredential());
+        } else {
+            promptBuilder = promptBuilder.setAllowBackgroundAuthentication(true /* allow */);
+        }
 
         // Check if the default subtitle should be used if subtitle is null/empty
         if (promptInfo.isUseDefaultSubtitle()) {
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
index 4a760ad..f2ebd1f 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
@@ -311,6 +311,7 @@
             mForceVerifyPath = userProperties.isCredentialShareableWithParent();
             if (android.multiuser.Flags.enableBiometricsToUnlockPrivateSpace()
                     && isBiometricAllowed(effectiveUserId, mUserId)) {
+                promptInfo.setUseParentProfileForDeviceCredential(true);
                 showBiometricPrompt(promptInfo, effectiveUserId);
                 launchedBiometric = true;
             } else {