Atom: Add BluetoothSocketConnectionStateChanged

* Logs when a Bluetooth socket's connection state is changed
* A Bluetooth socket can be:
  - RFCOMM socket
  - SCO socket
  - BR/EDR L2CAP socket
  - BLE L2CAP socket

Bug: 112969790
Test: make, test drive with statsd
Change-Id: I97b1e650e197a0dad1e2959e2f5b4dd98370d892
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 751b3e4..b96aa2e 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -237,6 +237,7 @@
         ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
         ProcessStartTime process_start_time = 169;
         PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
+        BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
     }
 
     // Pulled events will start at field 10000.
@@ -2067,6 +2068,36 @@
 }
 
 /**
+ * Logs when a Bluetooth socket’s connection state changed
+ *
+ * Logged from:
+ *   system/bt
+ */
+message BluetoothSocketConnectionStateChanged {
+    // An identifier that can be used to match events for this device.
+    // Currently, this is a salted hash of the MAC address of this Bluetooth device.
+    // Salt: Randomly generated 256 bit value
+    // Hash algorithm: HMAC-SHA256
+    // Size: 32 byte
+    // Default: null or empty if the device identifier is not known
+    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
+    // Port of this socket
+    // Default 0 when unknown or don't care
+    optional int32 port = 2;
+    // Socket type as mentioned in
+    // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
+    // Default: SOCKET_TYPE_UNKNOWN
+    optional android.bluetooth.SocketTypeEnum type = 3;
+    // Socket connection state
+    // Default: SOCKET_CONNECTION_STATE_UNKNOWN
+    optional android.bluetooth.SocketConnectionstateEnum state = 4;
+    // Number of bytes sent to remote device during this connection
+    optional int64 tx_bytes = 5;
+    // Number of bytes received from remote device during this connection
+    optional int64 rx_bytes = 6;
+}
+
+/**
  * Logs when something is plugged into or removed from the USB-C connector.
  *
  * Logged from: