| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.hardware.face; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.hardware.biometrics.ComponentInfoInternal; |
| 21 |
import android.hardware.biometrics.SensorProperties; |
| 22 |
import android.hardware.biometrics.SensorPropertiesInternal; |
| 23 |
import android.os.Parcel; |
| 24 |
|
| 25 |
import java.util.List; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
public class FaceSensorPropertiesInternal extends SensorPropertiesInternal { |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
public final @FaceSensorProperties.SensorType int sensorType; |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
public final boolean supportsFaceDetection; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
public final boolean supportsSelfIllumination; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
public FaceSensorPropertiesInternal(int sensorId, @SensorProperties.Strength int strength, |
| 52 |
int maxEnrollmentsPerUser, @NonNull List<ComponentInfoInternal> componentInfo, |
| 53 |
@FaceSensorProperties.SensorType int sensorType, boolean supportsFaceDetection, |
| 54 |
boolean supportsSelfIllumination, boolean resetLockoutRequiresChallenge) { |
| 55 |
|
| 56 |
|
| 57 |
super(sensorId, strength, maxEnrollmentsPerUser, componentInfo, |
| 58 |
true , resetLockoutRequiresChallenge); |
| 59 |
this.sensorType = sensorType; |
| 60 |
this.supportsFaceDetection = supportsFaceDetection; |
| 61 |
this.supportsSelfIllumination = supportsSelfIllumination; |
| 62 |
} |
| 63 |
|
| 64 |
protected FaceSensorPropertiesInternal(Parcel in) { |
| 65 |
super(in); |
| 66 |
sensorType = in.readInt(); |
| 67 |
supportsFaceDetection = in.readBoolean(); |
| 68 |
supportsSelfIllumination = in.readBoolean(); |
| 69 |
} |
| 70 |
|
| 71 |
public static final Creator<FaceSensorPropertiesInternal> CREATOR = |
| 72 |
new Creator<FaceSensorPropertiesInternal>() { |
| 73 |
@Override |
| 74 |
public FaceSensorPropertiesInternal createFromParcel(Parcel in) { |
| 75 |
return new FaceSensorPropertiesInternal(in); |
| 76 |
} |
| 77 |
|
| 78 |
@Override |
| 79 |
public FaceSensorPropertiesInternal[] newArray(int size) { |
| 80 |
return new FaceSensorPropertiesInternal[size]; |
| 81 |
} |
| 82 |
}; |
| 83 |
|
| 84 |
@Override |
| 85 |
public int describeContents() { |
| 86 |
return 0; |
| 87 |
} |
| 88 |
|
| 89 |
@Override |
| 90 |
public void writeToParcel(Parcel dest, int flags) { |
| 91 |
super.writeToParcel(dest, flags); |
| 92 |
dest.writeInt(sensorType); |
| 93 |
dest.writeBoolean(supportsFaceDetection); |
| 94 |
dest.writeBoolean(supportsSelfIllumination); |
| 95 |
} |
| 96 |
|
| 97 |
@Override |
| 98 |
public String toString() { |
| 99 |
return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType |
| 100 |
+ ", SupportsFaceDetection: " + supportsFaceDetection; |
| 101 |
} |
| 102 |
} |