Add UwbStartRanging message and corresponding enum.

Test: compile, manual
Bug: 236175866
Change-Id: If351c7067ec0d1051ad334612cbe20422ae34aa4
(cherry picked from commit 24bb25d5420df4bac1c35efc3a801640b48bd6ee)
Merged-In: If351c7067ec0d1051ad334612cbe20422ae34aa4
diff --git a/stats/atoms.proto b/stats/atoms.proto
index 4469988..15e0895 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -728,6 +728,7 @@
         ProviderAcquisitionEventReported provider_acquisition_event_reported =
                 477 [(module) = "framework"];
         BluetoothDeviceNameReported bluetooth_device_name_reported = 478 [(module) = "bluetooth"];
+        UwbStartRanging uwb_ranging_start = 489 [(module) = "uwb"];
         NetworkDnsServerSupportReported network_dns_server_support_reported = 504 [(module) = "resolv"];
         VmBooted vm_booted = 505 [(module) = "virtualizationservice"];
         VmExited vm_exited = 506 [(module) = "virtualizationservice"];
@@ -20218,6 +20219,28 @@
 }
 
 /*
+ * Logs details of start UWB ranging
+ * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
+ */
+message UwbStartRanging {
+    // UWB profiles
+    optional android.uwb.Profile profile = 1;
+    // Scrambled timestamp sequence (STS) Type
+    optional android.uwb.Sts sts = 2;
+    // Was it an initiator as opposed to responder?
+    optional bool is_initiator = 3;
+    // Was it a controller as opposed to controlee?
+    optional bool is_controller = 4;
+    // Was the connection done by the app as opposed to by the framework?
+    optional bool is_framework_initiated = 5;
+    // Was it out-of-band connection as opposed to in-band connection?
+    // Note that this field is ignored if is_framework_initiated is false.
+    optional bool is_out_of_band = 6;
+    // The status code of ranging start.
+    optional android.uwb.RangingStatus status = 7;
+}
+
+/*
  * Log that the ranging measurement is received
  * Logged from packages/modules/Uwb/service/java/com/android/server/uwb/UwbMetrics.java
  */
diff --git a/stats/enums/uwb/enums.proto b/stats/enums/uwb/enums.proto
index 9802a5b..99aac80 100644
--- a/stats/enums/uwb/enums.proto
+++ b/stats/enums/uwb/enums.proto
@@ -48,6 +48,22 @@
     PROVISION_FAILED = 8;
 }
 
+// UWB ranging session status codes
+enum RangingStatus {
+    RANGING_STATUS_UNKNOWN = 0;
+    RANGING_SUCCESS = 1;
+    RANGING_GENERAL_FAILURE = 2;
+    RANGING_BAD_PARAMs = 3;
+    RANGING_REJECTED = 4;
+    TX_FAILED = 5;
+    RX_PHY_DEC_FAILED = 6;
+    RX_PHY_TOA_FAILED = 7;
+    RX_PHY_STS_FAILED = 8;
+    RX_MAC_DEC_FAILED = 9;
+    RX_MAC_IE_DEC_FAILED = 10;
+    RX_MAC_IE_MISSING = 11;
+}
+
 // UWB session duration buckets
 enum DurationBucket {
     DURATION_UNKNOWN = 0;