Update face & fingerprint pref logic

This change makes it possible for face & fingerprint settings to be
presented to the user only to delete their face/fingerprint if the
feature has been disabled by a device admin.

Bug: 323280069
Test: atest BiometricFaceStatusPreferenceControllerTest
BiometricFingerprintStatusPreferenceControllerTest

Change-Id: I62cab3ddf7cf708d1b0b4da61dc3ffb7052dee84
This commit is contained in:
Joshua McCloskey
2024-04-29 22:22:31 +00:00
parent 1eca5e767d
commit 3e25356829
18 changed files with 213 additions and 13 deletions

View File

@@ -691,10 +691,16 @@ public class FingerprintSettings extends SubSettings {
// retryFingerprint() will be called when remove finishes
// need to disable enroll or have a way to determine if enroll is in progress
final boolean removalInProgress = mRemovalSidecar.inProgress();
final boolean isDeviceOwnerBlockingAuth =
RestrictedLockUtilsInternal.checkIfKeyguardFeaturesDisabled(
getContext(), DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT,
mUserId) != null;
CharSequence maxSummary = tooMany ?
getContext().getString(R.string.fingerprint_add_max, max) : "";
mAddFingerprintPreference.setSummary(maxSummary);
mAddFingerprintPreference.setEnabled(!tooMany && !removalInProgress && mToken != null);
mAddFingerprintPreference.setEnabled(!isDeviceOwnerBlockingAuth
&& !tooMany && !removalInProgress && mToken != null);
}
private void createFooterPreference(PreferenceGroup root) {