Merge "Add fields to SensorProperties"
This commit is contained in:
@@ -25,20 +25,36 @@ import android.os.Parcelable;
|
||||
*/
|
||||
public class FaceSensorProperties implements Parcelable {
|
||||
|
||||
/**
|
||||
* A statically configured ID representing this sensor. Sensor IDs must be unique across all
|
||||
* biometrics across the device, starting at 0, and in increments of 1.
|
||||
*/
|
||||
public final int sensorId;
|
||||
/**
|
||||
* True if the sensor is able to perform generic face detection, without running the
|
||||
* matching algorithm, and without affecting the lockout counter.
|
||||
*/
|
||||
public final boolean supportsFaceDetection;
|
||||
/**
|
||||
* True if the sensor is able to provide self illumination in dark scenarios, without support
|
||||
* from above the HAL.
|
||||
*/
|
||||
public final boolean supportsSelfIllumination;
|
||||
|
||||
/**
|
||||
* Initializes SensorProperties with specified values
|
||||
*/
|
||||
public FaceSensorProperties(int sensorId, boolean supportsFaceDetection) {
|
||||
public FaceSensorProperties(int sensorId, boolean supportsFaceDetection,
|
||||
boolean supportsSelfIllumination) {
|
||||
this.sensorId = sensorId;
|
||||
this.supportsFaceDetection = supportsFaceDetection;
|
||||
this.supportsSelfIllumination = supportsSelfIllumination;
|
||||
}
|
||||
|
||||
protected FaceSensorProperties(Parcel in) {
|
||||
sensorId = in.readInt();
|
||||
supportsFaceDetection = in.readBoolean();
|
||||
supportsSelfIllumination = in.readBoolean();
|
||||
}
|
||||
|
||||
public static final Creator<FaceSensorProperties> CREATOR =
|
||||
@@ -63,5 +79,6 @@ public class FaceSensorProperties implements Parcelable {
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(sensorId);
|
||||
dest.writeBoolean(supportsFaceDetection);
|
||||
dest.writeBoolean(supportsSelfIllumination);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4212,15 +4212,20 @@
|
||||
</integer-array>
|
||||
|
||||
<!-- Messages that should not be shown to the user during face authentication, on
|
||||
BiometricPrompt. 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 -->
|
||||
BiometricPrompt. 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 -->
|
||||
<integer-array name="config_face_acquire_biometricprompt_ignorelist" translatable="false" >
|
||||
</integer-array>
|
||||
<!-- Same as the above, but are defined by vendorCodes -->
|
||||
<integer-array name="config_face_acquire_vendor_biometricprompt_ignorelist" translatable="false" >
|
||||
</integer-array>
|
||||
|
||||
<!-- True if the sensor is able to provide self illumination in dark secnarios, without support
|
||||
from above the HAL. This configuration is only applicable to IBiometricsFace@1.0 and its
|
||||
minor revisions. -->
|
||||
<bool name="config_faceAuthSupportsSelfIllumination">true</bool>
|
||||
|
||||
<!-- If face auth sends the user directly to home/last open app, or stays on keyguard -->
|
||||
<bool name="config_faceAuthDismissesKeyguard">true</bool>
|
||||
|
||||
|
||||
@@ -2514,6 +2514,7 @@
|
||||
<java-symbol type="array" name="config_face_acquire_vendor_keyguard_ignorelist" />
|
||||
<java-symbol type="array" name="config_face_acquire_biometricprompt_ignorelist" />
|
||||
<java-symbol type="array" name="config_face_acquire_vendor_biometricprompt_ignorelist" />
|
||||
<java-symbol type="bool" name="config_faceAuthSupportsSelfIllumination" />
|
||||
<java-symbol type="bool" name="config_faceAuthDismissesKeyguard" />
|
||||
|
||||
<!-- Face config -->
|
||||
|
||||
@@ -182,7 +182,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
||||
// IBiometricsFace@1.0 does not support detection, only authentication.
|
||||
when(mFaceSensorProperties.isEmpty()).thenReturn(false);
|
||||
when(mFaceSensorProperties.get(anyInt())).thenReturn(new FaceSensorProperties(0 /* id */,
|
||||
false /* supportsFaceDetection */));
|
||||
false /* supportsFaceDetection */, true /* supportsSelfIllumination */));
|
||||
|
||||
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||
when(mFingerprintManager.hasEnrolledTemplates(anyInt())).thenReturn(true);
|
||||
|
||||
@@ -45,6 +45,7 @@ import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.util.Slog;
|
||||
|
||||
import com.android.internal.R;
|
||||
import com.android.internal.util.FrameworkStatsLog;
|
||||
import com.android.server.biometrics.Utils;
|
||||
import com.android.server.biometrics.sensors.AcquisitionClient;
|
||||
@@ -275,7 +276,10 @@ class Face10 implements IHwBinder.DeathRecipient {
|
||||
|
||||
Face10(@NonNull Context context, int sensorId,
|
||||
@NonNull LockoutResetDispatcher lockoutResetDispatcher) {
|
||||
mFaceSensorProperties = new FaceSensorProperties(sensorId, false /* supportsFaceDetect */);
|
||||
final boolean supportsSelfIllumination = context.getResources()
|
||||
.getBoolean(R.bool.config_faceAuthSupportsSelfIllumination);
|
||||
mFaceSensorProperties = new FaceSensorProperties(sensorId, false /* supportsFaceDetect */,
|
||||
supportsSelfIllumination);
|
||||
mContext = context;
|
||||
mSensorId = sensorId;
|
||||
mScheduler = new BiometricScheduler(TAG, null /* gestureAvailabilityTracker */);
|
||||
|
||||
Reference in New Issue
Block a user