Support face unlock for PS if class2 biometric and above

With this change it is checked if face unlock is supported as a class2
or class3 biometrics on the device.
If face is convenience biometrics then face unlock for
private space controller is not added.

Bug: 329044103
Test: atest UtilsTest and verified Face unlock is not added if face is convenience
Change-Id: I6e1a6557774be1173ad3ee7ff7b14d51f9fe1716
This commit is contained in:
josephpv
2024-03-13 14:53:31 +00:00
committed by Joseph Vincent
parent bc48abe0bd
commit 1791ce216b
5 changed files with 100 additions and 8 deletions

View File

@@ -73,13 +73,14 @@ public class UseOneLockSettingsFragment extends DashboardFragment {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new UseOneLockControllerSwitch(context, this));
controllers.add(new PrivateSpaceLockController(context, this));
if (Utils.isMultipleBiometricsSupported(context)) {
boolean isFaceAuthAllowed = Utils.isFaceNotConvenienceBiometric(context);
if (Utils.isMultipleBiometricsSupported(context) && isFaceAuthAllowed) {
controllers.add(new FaceFingerprintUnlockController(context, getSettingsLifecycle()));
} else if (Utils.hasFingerprintHardware(context)) {
controllers.add(
new PrivateSpaceFingerprintPreferenceController(
context, "private_space_biometrics", getSettingsLifecycle()));
} else if (Utils.hasFaceHardware(context)) {
} else if (Utils.hasFaceHardware(context) && isFaceAuthAllowed) {
controllers.add(
new PrivateSpaceFacePreferenceController(
context, "private_space_biometrics", getSettingsLifecycle()));