diff options
| author | Kevin Chyn <kchyn@google.com> | 2021-03-15 16:54:29 -0700 |
|---|---|---|
| committer | Kevin Chyn <kchyn@google.com> | 2021-03-15 16:56:04 -0700 |
| commit | dd77d27c1342b01c428dbc152f2463dbaaa87937 (patch) | |
| tree | 2f41b951019e7eb019b3ae2c80a7be85129a5a9a /core/java | |
| parent | b4dfa621f7b8e4f16efb9532b8936dc174f9ea6c (diff) | |
Update lockout-related properties for easier understandability
1) resetLockoutRequiresHardwareAuthToken is moved to the base
SensorPropertiesinternal class, despite face always requiring
it. This will be clearer, since we are further splitting
resetLockout logic into "challenge-required" (IBiometricsFace@1.0)
and "challenge-less" (IFace@1.0) It would be weird to have
a "resetLockoutRequiresChallenge" property without a
"resetLockoutRequiresHardwareAuthToken" property.
2) Will be adding a resetLockoutRequiresChallenge to
SensorPropertiesInternal in the next CL.
Bug: 182327296
Test: reset lockout on Pixel4
Change-Id: Ifa4b36dc42d91e967506a59d2880f47f61ec6cdf
Diffstat (limited to 'core/java')
3 files changed, 12 insertions, 15 deletions
diff --git a/core/java/android/hardware/biometrics/SensorPropertiesInternal.java b/core/java/android/hardware/biometrics/SensorPropertiesInternal.java index 0b81c6c8cc25..32d8bb5e94f6 100644 --- a/core/java/android/hardware/biometrics/SensorPropertiesInternal.java +++ b/core/java/android/hardware/biometrics/SensorPropertiesInternal.java @@ -31,23 +31,26 @@ public class SensorPropertiesInternal implements Parcelable { public final int sensorId; @SensorProperties.Strength public final int sensorStrength; public final int maxEnrollmentsPerUser; + public final boolean resetLockoutRequiresHardwareAuthToken; public static SensorPropertiesInternal from(@NonNull SensorPropertiesInternal prop) { return new SensorPropertiesInternal(prop.sensorId, prop.sensorStrength, - prop.maxEnrollmentsPerUser); + prop.maxEnrollmentsPerUser, prop.resetLockoutRequiresHardwareAuthToken); } protected SensorPropertiesInternal(int sensorId, @SensorProperties.Strength int sensorStrength, - int maxEnrollmentsPerUser) { + int maxEnrollmentsPerUser, boolean resetLockoutRequiresHardwareAuthToken) { this.sensorId = sensorId; this.sensorStrength = sensorStrength; this.maxEnrollmentsPerUser = maxEnrollmentsPerUser; + this.resetLockoutRequiresHardwareAuthToken = resetLockoutRequiresHardwareAuthToken; } protected SensorPropertiesInternal(Parcel in) { sensorId = in.readInt(); sensorStrength = in.readInt(); maxEnrollmentsPerUser = in.readInt(); + resetLockoutRequiresHardwareAuthToken = in.readBoolean(); } public static final Creator<SensorPropertiesInternal> CREATOR = @@ -73,6 +76,7 @@ public class SensorPropertiesInternal implements Parcelable { dest.writeInt(sensorId); dest.writeInt(sensorStrength); dest.writeInt(maxEnrollmentsPerUser); + dest.writeBoolean(resetLockoutRequiresHardwareAuthToken); } @Override diff --git a/core/java/android/hardware/face/FaceSensorPropertiesInternal.java b/core/java/android/hardware/face/FaceSensorPropertiesInternal.java index b9c0d12de22b..504f90c43e57 100644 --- a/core/java/android/hardware/face/FaceSensorPropertiesInternal.java +++ b/core/java/android/hardware/face/FaceSensorPropertiesInternal.java @@ -42,7 +42,10 @@ public class FaceSensorPropertiesInternal extends SensorPropertiesInternal { public FaceSensorPropertiesInternal(int sensorId, @SensorProperties.Strength int strength, int maxEnrollmentsPerUser, boolean supportsFaceDetection, boolean supportsSelfIllumination) { - super(sensorId, strength, maxEnrollmentsPerUser); + // resetLockout is managed by the HAL and requires a HardwareAuthToken for all face + // HAL interfaces (IBiometricsFace@1.0 HIDL and IFace@1.0 AIDL). + super(sensorId, strength, maxEnrollmentsPerUser, + true /* resetLockoutRequiresHardwareAuthToken */); this.supportsFaceDetection = supportsFaceDetection; this.supportsSelfIllumination = supportsSelfIllumination; } diff --git a/core/java/android/hardware/fingerprint/FingerprintSensorPropertiesInternal.java b/core/java/android/hardware/fingerprint/FingerprintSensorPropertiesInternal.java index 51addc95ac79..536b5d779741 100644 --- a/core/java/android/hardware/fingerprint/FingerprintSensorPropertiesInternal.java +++ b/core/java/android/hardware/fingerprint/FingerprintSensorPropertiesInternal.java @@ -36,12 +36,6 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna public final @FingerprintSensorProperties.SensorType int sensorType; /** - * IBiometricsFingerprint@2.1 does not manage timeout below the HAL, so the Gatekeeper HAT - * cannot be checked - */ - public final boolean resetLockoutRequiresHardwareAuthToken; - - /** * The location of the center of the sensor if applicable. For example, sensors of type * {@link FingerprintSensorProperties#TYPE_UDFPS_OPTICAL} would report this value as the * distance in pixels, measured from the left edge of the screen. @@ -68,9 +62,8 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna @FingerprintSensorProperties.SensorType int sensorType, boolean resetLockoutRequiresHardwareAuthToken, int sensorLocationX, int sensorLocationY, int sensorRadius) { - super(sensorId, strength, maxEnrollmentsPerUser); + super(sensorId, strength, maxEnrollmentsPerUser, resetLockoutRequiresHardwareAuthToken); this.sensorType = sensorType; - this.resetLockoutRequiresHardwareAuthToken = resetLockoutRequiresHardwareAuthToken; this.sensorLocationX = sensorLocationX; this.sensorLocationY = sensorLocationY; this.sensorRadius = sensorRadius; @@ -98,9 +91,8 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna @SensorProperties.Strength int strength, int maxEnrollmentsPerUser, @FingerprintSensorProperties.SensorType int sensorType, boolean resetLockoutRequiresHardwareAuthToken) { - super(sensorId, strength, maxEnrollmentsPerUser); + super(sensorId, strength, maxEnrollmentsPerUser, resetLockoutRequiresHardwareAuthToken); this.sensorType = sensorType; - this.resetLockoutRequiresHardwareAuthToken = resetLockoutRequiresHardwareAuthToken; int[] props = context.getResources().getIntArray( com.android.internal.R.array.config_udfps_sensor_props); @@ -119,7 +111,6 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna protected FingerprintSensorPropertiesInternal(Parcel in) { super(in); sensorType = in.readInt(); - resetLockoutRequiresHardwareAuthToken = in.readBoolean(); sensorLocationX = in.readInt(); sensorLocationY = in.readInt(); sensorRadius = in.readInt(); @@ -147,7 +138,6 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeInt(sensorType); - dest.writeBoolean(resetLockoutRequiresHardwareAuthToken); dest.writeInt(sensorLocationX); dest.writeInt(sensorLocationY); dest.writeInt(sensorRadius); |
