FPSettings depends on SensorProps for maxEnrolls

Test: Verified that AIDL FP devices honor the maximum number
of fp's allowed according to the HAL.
Fixes: 223617233

Change-Id: Ia0c46647d77ce52d4fe95154eae8d8b656456f53
This commit is contained in:
Joshua Mccloskey
2022-03-09 21:07:26 +00:00
parent f886179845
commit 5eda7f09d0
3 changed files with 14 additions and 8 deletions

View File

@@ -457,8 +457,10 @@ public class FingerprintSettings extends SubSettings {
final Preference addPreference = findPreference(KEY_FINGERPRINT_ADD);
/* Disable preference if too many fingerprints added */
final int max = getContext().getResources().getInteger(
com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser);
final List<FingerprintSensorPropertiesInternal> props =
mFingerprintManager.getSensorPropertiesInternal();
// This will need to be updated for devices with multiple fingerprint sensors
final int max = props.get(0).maxEnrollmentsPerUser;
boolean tooMany = mFingerprintManager.getEnrolledFingerprints(mUserId).size() >= max;
// retryFingerprint() will be called when remove finishes
// need to disable enroll or have a way to determine if enroll is in progress