Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71426803 authored by Jack He's avatar Jack He
Browse files

Bluetooth: Log class of device

* Add BluetoothClassOfDeviceReported atom to log class of device
  during connection and pairing

Bug: 112969790
Test: make, test drive with statsd
Change-Id: I8039f3f94f8bc4aa9ef2b67d04929421805d2432
parent d6ecaf06
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -259,6 +259,7 @@ message Atom {
        BiometricEnrolled biometric_enrolled = 184;
        SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
        TombStoneOccurred tomb_stone_occurred = 186;
        BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
    }

    // Pulled events will start at field 10000.
@@ -2141,6 +2142,29 @@ message BluetoothSocketConnectionStateChanged {
    optional android.bluetooth.SocketRoleEnum is_server = 9;
}

/**
 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
 *
 * Logged from:
 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
 *   packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
 *
 */
message BluetoothClassOfDeviceReported {
    // 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 this is a server listener socket
    optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
    // Class of Device (CoD) value including both Major, Minor device class and service class
    // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
    // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
    // Default: 0
    optional int32 class_of_device = 2;
}

/**
 * Logs when something is plugged into or removed from the USB-C connector.
 *