Merge "Adds property indicating presence of power button fingerprint sensor" into sc-dev

This commit is contained in:
Grace Cheng
2021-04-05 18:13:28 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 3 deletions

View File

@@ -4428,6 +4428,9 @@
-->
</integer-array>
<!-- Indicates whether device has a power button fingerprint sensor. -->
<bool name="config_is_powerbutton_fps" translatable="false" >false</bool>
<!-- Messages that should not be shown to the user during face auth enrollment. This should be
used to hide messages that may be too chatty or messages that the user can't do much about.
Entries are defined in android.hardware.biometrics.face@1.0 types.hal -->

View File

@@ -2558,6 +2558,7 @@
<java-symbol type="array" name="config_biometric_sensors" />
<java-symbol type="bool" name="allow_test_udfps" />
<java-symbol type="array" name="config_udfps_sensor_props" />
<java-symbol type="bool" name="config_is_powerbutton_fps" />
<java-symbol type="array" name="config_face_acquire_enroll_ignorelist" />
<java-symbol type="array" name="config_face_acquire_vendor_enroll_ignorelist" />

View File

@@ -119,6 +119,7 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
private int mCurrentUserId = UserHandle.USER_NULL;
private final boolean mIsUdfps;
private final int mSensorId;
private boolean mIsPowerbuttonFps;
private final class BiometricTaskStackListener extends TaskStackListener {
@Override
@@ -345,9 +346,18 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
mIsUdfps = !ArrayUtils.isEmpty(
mContext.getResources().getIntArray(R.array.config_udfps_sensor_props));
final @FingerprintSensorProperties.SensorType int sensorType =
mIsUdfps ? FingerprintSensorProperties.TYPE_UDFPS_OPTICAL
: FingerprintSensorProperties.TYPE_REAR;
// config_is_powerbutton_fps indicates whether device has a power button fingerprint sensor.
mIsPowerbuttonFps = mContext.getResources().getBoolean(R.bool.config_is_powerbutton_fps);
final @FingerprintSensorProperties.SensorType int sensorType;
if (mIsUdfps) {
sensorType = FingerprintSensorProperties.TYPE_UDFPS_OPTICAL;
} else if (mIsPowerbuttonFps) {
sensorType = FingerprintSensorProperties.TYPE_POWER_BUTTON;
} else {
sensorType = FingerprintSensorProperties.TYPE_REAR;
}
// IBiometricsFingerprint@2.1 does not manage timeout below the HAL, so the Gatekeeper HAT
// cannot be checked
final boolean resetLockoutRequiresHardwareAuthToken = false;
@@ -835,6 +845,7 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
try {
dump.put("service", TAG);
dump.put("isUdfps", mIsUdfps);
dump.put("isPowerbuttonFps", mIsPowerbuttonFps);
JSONArray sets = new JSONArray();
for (UserInfo user : UserManager.get(mContext).getUsers()) {