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

@@ -312,9 +312,10 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
default:
FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this);
int enrolled = fpm.getEnrolledFingerprints().size();
int max = getResources().getInteger(
com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser);
if (enrolled >= max) {
final List<FingerprintSensorPropertiesInternal> props =
fpm.getSensorPropertiesInternal();
final int maxEnrollments = props.get(0).maxEnrollmentsPerUser;
if (enrolled >= maxEnrollments) {
finish();
} else {
// We came back from enrolling but it wasn't completed, start again.