From cd690782caf99aa3b517f2d4d2659e666ef660ad Mon Sep 17 00:00:00 2001 From: Ilya Matyukhin Date: Fri, 26 Feb 2021 13:53:17 -0800 Subject: [PATCH] Set enum defaults for biometrics Bug: 179853316 Test: m android.hardware.biometrics.common-update-api Test: m android.hardware.biometrics.fingerprint-update-api Test: m android.hardware.biometrics.face-update-api Test: build Change-Id: Ia13a0e59a5009e17496e84c593a64e3da27fac05 --- .../biometrics/common/CommonProps.aidl | 31 ++++++++++++++----- .../biometrics/common/HardwareInfo.aidl | 29 ++++++++++++----- .../common/ICancellationSignal.aidl | 29 ++++++++++++----- .../biometrics/common/SensorStrength.aidl | 29 ++++++++++++----- .../biometrics/common/CommonProps.aidl | 4 +-- .../hardware/biometrics/face/BaseFrame.aidl | 2 +- .../biometrics/face/EnrollmentFrame.aidl | 2 +- .../face/EnrollmentStageConfig.aidl | 2 +- .../hardware/biometrics/face/SensorProps.aidl | 2 +- .../hardware/biometrics/face/BaseFrame.aidl | 2 +- .../biometrics/face/EnrollmentFrame.aidl | 4 +-- .../face/EnrollmentStageConfig.aidl | 2 +- .../hardware/biometrics/face/SensorProps.aidl | 3 +- .../biometrics/fingerprint/SensorProps.aidl | 2 +- .../biometrics/fingerprint/SensorProps.aidl | 3 +- 15 files changed, 102 insertions(+), 44 deletions(-) diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl index 8dbc149fa8..30959b10e7 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl @@ -1,14 +1,29 @@ -/////////////////////////////////////////////////////////////////////////////// +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// You must not make a backward incompatible change to any AIDL file built // with the aidl_interface module type with versions property set. The module // type is used to build AIDL files in a way that they can be used across // independently updatable components of the system. If a device is shipped @@ -19,7 +34,7 @@ package android.hardware.biometrics.common; @VintfStability parcelable CommonProps { int sensorId; - android.hardware.biometrics.common.SensorStrength sensorStrength; + android.hardware.biometrics.common.SensorStrength sensorStrength = android.hardware.biometrics.common.SensorStrength.CONVENIENCE; int maxEnrollmentsPerUser; android.hardware.biometrics.common.HardwareInfo[] hardwareInfo; } diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/HardwareInfo.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/HardwareInfo.aidl index b94b6b0174..8fea864986 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/HardwareInfo.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/HardwareInfo.aidl @@ -1,14 +1,29 @@ -/////////////////////////////////////////////////////////////////////////////// +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// You must not make a backward incompatible change to any AIDL file built // with the aidl_interface module type with versions property set. The module // type is used to build AIDL files in a way that they can be used across // independently updatable components of the system. If a device is shipped diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ICancellationSignal.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ICancellationSignal.aidl index 1a875bfbd8..b85a590612 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ICancellationSignal.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/ICancellationSignal.aidl @@ -1,14 +1,29 @@ -/////////////////////////////////////////////////////////////////////////////// +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// You must not make a backward incompatible change to any AIDL file built // with the aidl_interface module type with versions property set. The module // type is used to build AIDL files in a way that they can be used across // independently updatable components of the system. If a device is shipped diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl index eaff85d2f9..3b20c9aa98 100644 --- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl +++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl @@ -1,14 +1,29 @@ -/////////////////////////////////////////////////////////////////////////////// +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//////////////////////////////////////////////////////////////////////////////// // THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // /////////////////////////////////////////////////////////////////////////////// -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. // -// You must not make a backward incompatible changes to the AIDL files built +// You must not make a backward incompatible change to any AIDL file built // with the aidl_interface module type with versions property set. The module // type is used to build AIDL files in a way that they can be used across // independently updatable components of the system. If a device is shipped diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl index 9c3fd58090..59f398ef4e 100644 --- a/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl +++ b/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl @@ -33,7 +33,7 @@ parcelable CommonProps { * A statically configured strength for this sensor. See the SensorStrength interface for more * information. */ - SensorStrength sensorStrength; + SensorStrength sensorStrength = SensorStrength.CONVENIENCE; /** * The maximum number of enrollments that a single user can have. Statically configured. @@ -44,4 +44,4 @@ parcelable CommonProps { * A list of hardware information for subsystems that pertain to this biometric sensor. */ HardwareInfo[] hardwareInfo; -} \ No newline at end of file +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl index a93510160b..99397051f2 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl @@ -33,7 +33,7 @@ package android.hardware.biometrics.face; @VintfStability parcelable BaseFrame { - android.hardware.biometrics.face.AcquiredInfo acquiredInfo; + android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.INSUFFICIENT; int vendorCode; float pan; float tilt; diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl index cc78e6b077..cb9a6c682b 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -34,6 +34,6 @@ package android.hardware.biometrics.face; @VintfStability parcelable EnrollmentFrame { @nullable android.hardware.biometrics.face.Cell cell; - android.hardware.biometrics.face.EnrollmentStage stage; + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.FIRST_FRAME_RECEIVED; android.hardware.biometrics.face.BaseFrame data; } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl index d13eccd0fe..f55aafdb7c 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -33,6 +33,6 @@ package android.hardware.biometrics.face; @VintfStability parcelable EnrollmentStageConfig { - android.hardware.biometrics.face.EnrollmentStage stage; + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.FIRST_FRAME_RECEIVED; List cells; } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl index 23a8d4dddc..69355fbe69 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl @@ -34,7 +34,7 @@ package android.hardware.biometrics.face; @VintfStability parcelable SensorProps { android.hardware.biometrics.common.CommonProps commonProps; - android.hardware.biometrics.face.FaceSensorType sensorType; + android.hardware.biometrics.face.FaceSensorType sensorType = android.hardware.biometrics.face.FaceSensorType.RGB; boolean halControlsPreview; int enrollPreviewWidth; int enrollPreviewHeight; diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl index 9e6b98adfa..85535f920d 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl @@ -29,7 +29,7 @@ parcelable BaseFrame { * Information about the frame that can be used by the framework to provide feedback to the * user, for example ask the user to move their face in a certain way. */ - AcquiredInfo acquiredInfo; + AcquiredInfo acquiredInfo = AcquiredInfo.INSUFFICIENT; /** * If acquiredInfo is set to AcquiredInfo::VENDOR. This is the index into the configuration diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl index d4f9771d03..ea0a502166 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -16,9 +16,9 @@ package android.hardware.biometrics.face; +import android.hardware.biometrics.face.BaseFrame; import android.hardware.biometrics.face.Cell; import android.hardware.biometrics.face.EnrollmentStage; -import android.hardware.biometrics.face.BaseFrame; /** * Describes an individual frame captured during enrollment. @@ -33,7 +33,7 @@ parcelable EnrollmentFrame { /** * The enrollment stage for which this frame was captured. */ - EnrollmentStage stage; + EnrollmentStage stage = EnrollmentStage.FIRST_FRAME_RECEIVED; /** * The frame metadata. Can be used by the framework to provide user feedback. diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl index 0b64e2bfbd..3c31fcc977 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -24,7 +24,7 @@ parcelable EnrollmentStageConfig { /** * The stage that's being configured. */ - EnrollmentStage stage; + EnrollmentStage stage = EnrollmentStage.FIRST_FRAME_RECEIVED; /** * Optional list of cells that must be completed to finish this stage. diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl index 091e3225a3..b11b436098 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl @@ -29,7 +29,7 @@ parcelable SensorProps { /** * A statically configured sensor type representing this face sensor. */ - FaceSensorType sensorType; + FaceSensorType sensorType = FaceSensorType.RGB; /** * Whether or not the HAL is responsible for showing the face enrollment preview to the user. @@ -76,4 +76,3 @@ parcelable SensorProps { */ boolean supportsDetectInteraction; } - diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl index 53ac6dd917..00cbb6da86 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -34,7 +34,7 @@ package android.hardware.biometrics.fingerprint; @VintfStability parcelable SensorProps { android.hardware.biometrics.common.CommonProps commonProps; - android.hardware.biometrics.fingerprint.FingerprintSensorType sensorType; + android.hardware.biometrics.fingerprint.FingerprintSensorType sensorType = android.hardware.biometrics.fingerprint.FingerprintSensorType.UNKNOWN; android.hardware.biometrics.fingerprint.SensorLocation[] sensorLocations; boolean supportsNavigationGestures; boolean supportsDetectInteraction; diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl index 5222f3ea3a..fd2cf47d9e 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -30,7 +30,7 @@ parcelable SensorProps { /** * A statically configured sensor type representing this fingerprint sensor. */ - FingerprintSensorType sensorType; + FingerprintSensorType sensorType = FingerprintSensorType.UNKNOWN; /** * A list of display-specific locations from where the sensor is usable from. See SensorLocation @@ -49,4 +49,3 @@ parcelable SensorProps { */ boolean supportsDetectInteraction; } -