Define BiometricPropertiesCollected atom

Bug: 216195167
Bug: 204801320
Test: make -j
Change-Id: I4b5b87eb307de9d8165bdcf4e30bfe1b3593ca82
diff --git a/stats/atoms.proto b/stats/atoms.proto
index 6e0e948..91444df 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -911,6 +911,8 @@
         credentials.CredentialManagerApiCalled credential_manager_api_called = 585 [(module) = "framework"];
         providers.mediaprovider.MediaProviderVolumeRecoveryReported
             media_provider_volume_recovery_reported = 586 [(module) = "mediaprovider"];
+        hardware.biometrics.BiometricPropertiesCollected
+            biometric_properties_collected = 587 [(module) = "framework"];
         // StatsdStats tracks platform atoms with ids upto 750.
         // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
     }
diff --git a/stats/atoms/hardware/biometrics/biometrics_atoms.proto b/stats/atoms/hardware/biometrics/biometrics_atoms.proto
index a86d5ca..338e260 100644
--- a/stats/atoms/hardware/biometrics/biometrics_atoms.proto
+++ b/stats/atoms/hardware/biometrics/biometrics_atoms.proto
@@ -70,3 +70,48 @@
 optional bool is_aod = 11;
 }
 
+/**
+ * Logs biometric sensor properties when boot completed.
+ *
+ * Pushed from:
+ *   frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java
+ */
+message BiometricPropertiesCollected {
+    // The ID of the biometric sensor whose properties are being collected.
+    optional int32 sensor_id = 1;
+
+    // The biometric modality of the sensor (i.e. face, fingerprint, iris).
+    optional android.hardware.biometrics.ModalityEnum modality = 2;
+
+    // The specific type of the sensor.
+    optional android.hardware.biometrics.SensorTypeEnum sensor_type = 3;
+
+    // The biometric strength of the sensor.
+    optional android.hardware.biometrics.StrengthEnum sensor_strength = 4;
+
+    // The following is a list of component information for the subsystems that
+    // pertain to the sensor. None of the component info is a device identifier
+    // since every device of a given model and build share the same info.
+    // An identifier uniquely identifying a subsystem. It must not be an empty
+    // string.
+    optional string component_info_component_id = 5;
+
+    // The hardware version of a biometric subsystem. For example,
+    // <vendor>/<model>/<revision>. If there is no hardware version for this
+    // component, it must be empty.
+    optional string component_info_hardware_version = 6;
+
+    // The firmware version of a biometric subsystem. If there's no firmware
+    // version for this component, it must be empty.
+    optional string component_info_firmware_version = 7;
+
+    // The serial number of a biometric subsystem. If there's no serial number
+    // for this component, it must be empty.
+    optional string component_info_serial_number = 8;
+
+    // The software version of a biometric subsystem. For example,
+    // <vendor>/<version>/<revision>. If there's no software version for this
+    // component, it must be empty.
+    optional string component_info_software_version = 9;
+}
+
diff --git a/stats/enums/hardware/biometrics/enums.proto b/stats/enums/hardware/biometrics/enums.proto
index d961f1e..42dafe0 100644
--- a/stats/enums/hardware/biometrics/enums.proto
+++ b/stats/enums/hardware/biometrics/enums.proto
@@ -95,3 +95,31 @@
 enum WakeReasonEnum {
     WAKE_REASON_UNKNOWN = 0;
 }
+
+enum StrengthEnum {
+    STRENGTH_UNKNOWN = 0;
+    // A sensor that meets the requirements for Class 1 biometrics as defined in
+    // the CDD. This does not correspond to a public
+    // BiometricManager.Authenticators constant. Sensors of this strength are
+    // not available to applications via the public API surface.
+    STRENGTH_CONVENIENCE = 1;
+    // A sensor that meets the requirements for Class 2 biometrics as defined in
+    // the CDD. Corresponds to BiometricManager.Authenticators.BIOMETRIC_WEAK.
+    STRENGTH_WEAK = 2;
+    // A sensor that meets the requirements for Class 3 biometrics as defined in
+    // the CDD. Corresponds to BiometricManager.Authenticators.BIOMETRIC_STRONG.
+    // Notably, this is the only strength that allows generation of
+    // HardwareAuthToken(s).
+    STRENGTH_STRONG = 3;
+}
+
+enum SensorTypeEnum {
+    SENSOR_UNKNOWN = 0;
+    SENSOR_FP_REAR = 1;
+    SENSOR_FP_UDFPS_ULTRASONIC = 2;
+    SENSOR_FP_UDFPS_OPTICAL = 3;
+    SENSOR_FP_POWER_BUTTON = 4;
+    SENSOR_FP_HOME_BUTTON = 5;
+    SENSOR_FACE_RGB = 6;
+    SENSOR_FACE_IR = 7;
+}