Disable combined controller only if all modalities require consent

Additionally, ensure that consent is only requested for modalities
that have not been previously consented to. We retrieve the consent
requirement (which come from DPM) in onActivityResult instead of
onCreate, since the signal may not be ready immediately.

Fixes: 196060286
Fixes: 204592495
Test: make -j56 RunSettingsRoboTests ROBOTEST_FILTER=CombinedBiometricStatusPreferenceControllerTest

Change-Id: I984e61f28ffbf957c16cac4ea84f40b6ad7d8ae9
This commit is contained in:
Kevin Chyn
2021-08-12 16:03:51 -07:00
parent ef0a786bd7
commit 156db33a56
5 changed files with 81 additions and 22 deletions

View File

@@ -52,8 +52,8 @@ public class ParentalConsentHelper {
private static final String KEY_FINGERPRINT_CONSENT_STRINGS = "fingerprint_strings";
private static final String KEY_IRIS_CONSENT_STRINGS = "iris_strings";
private final boolean mRequireFace;
private final boolean mRequireFingerprint;
private boolean mRequireFace;
private boolean mRequireFingerprint;
private long mGkPwHandle;
@Nullable
@@ -64,15 +64,19 @@ public class ParentalConsentHelper {
/**
* Helper for aggregating user consent.
*
* @param requireFace if face consent should be shown
* @param requireFingerprint if fingerprint consent should be shown
* @param gkPwHandle for launched intents
*/
public ParentalConsentHelper(boolean requireFace, boolean requireFingerprint,
@Nullable Long gkPwHandle) {
public ParentalConsentHelper(@Nullable Long gkPwHandle) {
mGkPwHandle = gkPwHandle != null ? gkPwHandle : 0L;
}
/**
* @param requireFace if face consent should be shown
* @param requireFingerprint if fingerprint consent should be shown
*/
public void setConsentRequirement(boolean requireFace, boolean requireFingerprint) {
mRequireFace = requireFace;
mRequireFingerprint = requireFingerprint;
mGkPwHandle = gkPwHandle != null ? gkPwHandle : 0L;
}
/**