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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user