Merge "Add nullability annotations and imports" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3d345db0a4
@@ -27,11 +27,11 @@ import android.os.Parcelable;
|
||||
*/
|
||||
public class ComponentInfoInternal implements Parcelable {
|
||||
|
||||
public final String componentId;
|
||||
public final String hardwareVersion;
|
||||
public final String firmwareVersion;
|
||||
public final String serialNumber;
|
||||
public final String softwareVersion;
|
||||
@NonNull public final String componentId;
|
||||
@NonNull public final String hardwareVersion;
|
||||
@NonNull public final String firmwareVersion;
|
||||
@NonNull public final String serialNumber;
|
||||
@NonNull public final String softwareVersion;
|
||||
|
||||
/**
|
||||
* Constructs a {@link ComponentInfoInternal} from another instance.
|
||||
@@ -45,8 +45,9 @@ public class ComponentInfoInternal implements Parcelable {
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public ComponentInfoInternal(String componentId, String hardwareVersion,
|
||||
String firmwareVersion, String serialNumber, String softwareVersion) {
|
||||
public ComponentInfoInternal(@NonNull String componentId, @NonNull String hardwareVersion,
|
||||
@NonNull String firmwareVersion, @NonNull String serialNumber,
|
||||
@NonNull String softwareVersion) {
|
||||
this.componentId = componentId;
|
||||
this.hardwareVersion = hardwareVersion;
|
||||
this.firmwareVersion = firmwareVersion;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SensorPropertiesInternal implements Parcelable {
|
||||
public final int sensorId;
|
||||
@SensorProperties.Strength public final int sensorStrength;
|
||||
public final int maxEnrollmentsPerUser;
|
||||
public final List<ComponentInfoInternal> componentInfo;
|
||||
@NonNull public final List<ComponentInfoInternal> componentInfo;
|
||||
public final boolean resetLockoutRequiresHardwareAuthToken;
|
||||
public final boolean resetLockoutRequiresChallenge;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.hardware.face;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.hardware.biometrics.ComponentInfoInternal;
|
||||
import android.hardware.biometrics.SensorProperties;
|
||||
|
||||
@@ -74,7 +75,8 @@ public class FaceSensorProperties extends SensorProperties {
|
||||
* @hide
|
||||
*/
|
||||
public FaceSensorProperties(int sensorId, int sensorStrength,
|
||||
List<ComponentInfo> componentInfo, @FaceSensorProperties.SensorType int sensorType) {
|
||||
@NonNull List<ComponentInfo> componentInfo,
|
||||
@FaceSensorProperties.SensorType int sensorType) {
|
||||
super(sensorId, sensorStrength, componentInfo);
|
||||
mSensorType = sensorType;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.hardware.face;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.hardware.biometrics.ComponentInfoInternal;
|
||||
import android.hardware.biometrics.SensorProperties;
|
||||
import android.hardware.biometrics.SensorPropertiesInternal;
|
||||
@@ -48,7 +49,7 @@ public class FaceSensorPropertiesInternal extends SensorPropertiesInternal {
|
||||
* Initializes SensorProperties with specified values
|
||||
*/
|
||||
public FaceSensorPropertiesInternal(int sensorId, @SensorProperties.Strength int strength,
|
||||
int maxEnrollmentsPerUser, List<ComponentInfoInternal> componentInfo,
|
||||
int maxEnrollmentsPerUser, @NonNull List<ComponentInfoInternal> componentInfo,
|
||||
@FaceSensorProperties.SensorType int sensorType, boolean supportsFaceDetection,
|
||||
boolean supportsSelfIllumination, boolean resetLockoutRequiresChallenge) {
|
||||
// resetLockout is managed by the HAL and requires a HardwareAuthToken for all face
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.hardware.fingerprint;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.hardware.biometrics.ComponentInfoInternal;
|
||||
import android.hardware.biometrics.SensorProperties;
|
||||
|
||||
@@ -94,7 +95,7 @@ public class FingerprintSensorProperties extends SensorProperties {
|
||||
* @hide
|
||||
*/
|
||||
public FingerprintSensorProperties(int sensorId, int sensorStrength,
|
||||
List<ComponentInfo> componentInfo, @SensorType int sensorType) {
|
||||
@NonNull List<ComponentInfo> componentInfo, @SensorType int sensorType) {
|
||||
super(sensorId, sensorStrength, componentInfo);
|
||||
mSensorType = sensorType;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
|
||||
|
||||
public FingerprintSensorPropertiesInternal(int sensorId,
|
||||
@SensorProperties.Strength int strength, int maxEnrollmentsPerUser,
|
||||
List<ComponentInfoInternal> componentInfo,
|
||||
@NonNull List<ComponentInfoInternal> componentInfo,
|
||||
@FingerprintSensorProperties.SensorType int sensorType,
|
||||
boolean resetLockoutRequiresHardwareAuthToken, int sensorLocationX, int sensorLocationY,
|
||||
int sensorRadius) {
|
||||
@@ -83,7 +83,7 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
|
||||
*/
|
||||
public FingerprintSensorPropertiesInternal(int sensorId,
|
||||
@SensorProperties.Strength int strength, int maxEnrollmentsPerUser,
|
||||
List<ComponentInfoInternal> componentInfo,
|
||||
@NonNull List<ComponentInfoInternal> componentInfo,
|
||||
@FingerprintSensorProperties.SensorType int sensorType,
|
||||
boolean resetLockoutRequiresHardwareAuthToken) {
|
||||
// TODO(b/179175438): Value should be provided from the HAL
|
||||
@@ -99,7 +99,7 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna
|
||||
// TODO(b/179175438): Remove this constructor once all HALs move to AIDL.
|
||||
public FingerprintSensorPropertiesInternal(@NonNull Context context, int sensorId,
|
||||
@SensorProperties.Strength int strength, int maxEnrollmentsPerUser,
|
||||
List<ComponentInfoInternal> componentInfo,
|
||||
@NonNull List<ComponentInfoInternal> componentInfo,
|
||||
@FingerprintSensorProperties.SensorType int sensorType,
|
||||
boolean resetLockoutRequiresHardwareAuthToken) {
|
||||
super(sensorId, strength, maxEnrollmentsPerUser, componentInfo,
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.hardware.biometrics.ComponentInfoInternal;
|
||||
import android.hardware.biometrics.IInvalidationCallback;
|
||||
import android.hardware.biometrics.ITestSession;
|
||||
import android.hardware.biometrics.ITestSessionCallback;
|
||||
import android.hardware.biometrics.common.ComponentInfo;
|
||||
import android.hardware.biometrics.face.IFace;
|
||||
import android.hardware.biometrics.face.SensorProps;
|
||||
import android.hardware.face.Face;
|
||||
@@ -137,8 +138,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
|
||||
final List<ComponentInfoInternal> componentInfo = new ArrayList<>();
|
||||
if (prop.commonProps.componentInfo != null) {
|
||||
for (android.hardware.biometrics.common.ComponentInfo info
|
||||
: prop.commonProps.componentInfo) {
|
||||
for (ComponentInfo info : prop.commonProps.componentInfo) {
|
||||
componentInfo.add(new ComponentInfoInternal(info.componentId,
|
||||
info.hardwareVersion, info.firmwareVersion, info.serialNumber,
|
||||
info.softwareVersion));
|
||||
|
||||
@@ -29,6 +29,7 @@ import android.hardware.biometrics.ComponentInfoInternal;
|
||||
import android.hardware.biometrics.IInvalidationCallback;
|
||||
import android.hardware.biometrics.ITestSession;
|
||||
import android.hardware.biometrics.ITestSessionCallback;
|
||||
import android.hardware.biometrics.common.ComponentInfo;
|
||||
import android.hardware.biometrics.fingerprint.IFingerprint;
|
||||
import android.hardware.biometrics.fingerprint.SensorProps;
|
||||
import android.hardware.fingerprint.Fingerprint;
|
||||
@@ -141,8 +142,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
|
||||
final List<ComponentInfoInternal> componentInfo = new ArrayList<>();
|
||||
if (prop.commonProps.componentInfo != null) {
|
||||
for (android.hardware.biometrics.common.ComponentInfo info
|
||||
: prop.commonProps.componentInfo) {
|
||||
for (ComponentInfo info : prop.commonProps.componentInfo) {
|
||||
componentInfo.add(new ComponentInfoInternal(info.componentId,
|
||||
info.hardwareVersion, info.firmwareVersion, info.serialNumber,
|
||||
info.softwareVersion));
|
||||
|
||||
Reference in New Issue
Block a user