From 71c3a5d485ea2354eadd9799994938ebf7bfacc7 Mon Sep 17 00:00:00 2001 From: Chen Chen Date: Fri, 6 Mar 2020 16:01:24 -0800 Subject: [PATCH] Bluetooth Metrics: Add metric_id field for Bluetooth metrics to proto. The incremental id is neither a device id nor a pseudo name and therefore PII free. Test: Build successfully Bug: 142563377 Change-Id: I5393aee2d1940470678c3d00153a4771e5e676e1 --- cmds/statsd/src/atoms.proto | 186 +++++++++++++++++++++++++++++++++++- 1 file changed, 183 insertions(+), 3 deletions(-) diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index 56f2340933d32..784da0f7de9e8 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -1704,7 +1704,7 @@ message BluetoothEnabledStateChanged { * Logged from: * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java * - * Next Tag: 5 + * Next Tag: 6 */ message BluetoothConnectionStateChanged { // The state of the connection. @@ -1726,6 +1726,15 @@ message BluetoothConnectionStateChanged { // Size: 32 byte // Default: null or empty if the device identifier is not known optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES]; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 5; } /** @@ -1734,7 +1743,7 @@ message BluetoothConnectionStateChanged { * Logged from: * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java * - * Next Tag: 3 + * Next Tag: 4 */ message BluetoothAclConnectionStateChanged { // An identifier that can be used to match events for this device. @@ -1747,6 +1756,15 @@ message BluetoothAclConnectionStateChanged { // The state of the connection. // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. optional android.bluetooth.ConnectionStateEnum state = 2; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 3; } /** @@ -1756,7 +1774,7 @@ message BluetoothAclConnectionStateChanged { * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java * - * Next Tag: 4 + * Next Tag: 5 */ message BluetoothScoConnectionStateChanged { // An identifier that can be used to match events for this device. @@ -1772,6 +1790,15 @@ message BluetoothScoConnectionStateChanged { // Codec used for this SCO connection // Default: UNKNOWN optional android.bluetooth.hfp.ScoCodec codec = 3; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 4; } /** @@ -1793,6 +1820,15 @@ message BluetoothActiveDeviceChanged { // Size: 32 byte // Default: null or empty if there is no active device for this profile optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES]; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 3; } // Logs when there is an event affecting Bluetooth device's link layer connection. @@ -1876,6 +1912,15 @@ message BluetoothLinkLayerConnectionEvent { // HCI reason code associated with this event // Default: STATUS_UNKNOWN optional android.bluetooth.hci.StatusEnum reason_code = 9; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 10; } /** @@ -1934,6 +1979,15 @@ message BluetoothA2dpPlaybackStateChanged { // Current audio coding mode // Default: AUDIO_CODING_MODE_UNKNOWN optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 4; } /** @@ -1972,6 +2026,15 @@ message BluetoothA2dpCodecConfigChanged { optional int64 codec_specific_2 = 8; optional int64 codec_specific_3 = 9; optional int64 codec_specific_4 = 10; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 11; } /** @@ -2014,6 +2077,15 @@ message BluetoothA2dpCodecCapabilityChanged { optional int64 codec_specific_2 = 8; optional int64 codec_specific_3 = 9; optional int64 codec_specific_4 = 10; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 11; } /** @@ -2037,6 +2109,15 @@ message BluetoothA2dpAudioUnderrunReported { // Number of bytes of PCM data that could not be read from the source // Default: 0 optional int32 num_missing_pcm_bytes = 3; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 4; } /** @@ -2067,6 +2148,15 @@ message BluetoothA2dpAudioOverrunReported { // Number of encoded bytes dropped in this event // Default: 0 optional int32 num_dropped_encoded_bytes = 5; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 6; } /** @@ -2098,6 +2188,15 @@ message BluetoothDeviceRssiReported { // Units: dBm // Invalid when an out of range value is reported optional int32 rssi = 4; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 5; } /** @@ -2125,6 +2224,15 @@ message BluetoothDeviceFailedContactCounterReported { // Range: uint16_t, 0-0xFFFF // Default: 0xFFFFF optional int32 failed_contact_counter = 4; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 5; } /** @@ -2152,6 +2260,15 @@ message BluetoothDeviceTxPowerLevelReported { // Units: dBm // Invalid when an out of range value is reported optional int32 transmit_power_level = 4; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 5; } /** @@ -2281,6 +2398,15 @@ message BluetoothDeviceInfoReported { optional string hardware_version = 6; // Software version of this device optional string software_version = 7; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 8; } /** @@ -2334,6 +2460,15 @@ message BluetoothSdpAttributeReported { optional int32 attribute_id = 3; // Attribute value for the particular attribute optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES]; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 5; } /** @@ -2366,6 +2501,15 @@ message BluetoothBondStateChanged { // Unbond Reason // Default: UNBOND_REASON_UNKNOWN optional android.bluetooth.UnbondReasonEnum unbond_reason = 6; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 7; } /** @@ -2401,6 +2545,15 @@ message BluetoothClassicPairingEventReported { // A status value related to this specific event // Default: 0 optional int64 event_value = 7; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 8; } /** @@ -2426,6 +2579,15 @@ message BluetoothSmpPairingEventReported { // SMP failure reason code // Default: PAIRING_FAIL_REASON_DEFAULT optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 5; } /** @@ -2464,6 +2626,15 @@ message BluetoothSocketConnectionStateChanged { optional int32 server_port = 8; // Whether this is a server listener socket optional android.bluetooth.SocketRoleEnum is_server = 9; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 10; } /** @@ -2487,6 +2658,15 @@ message BluetoothClassOfDeviceReported { // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass // Default: 0 optional int32 class_of_device = 2; + // An identifier that can be used to match events for this device. + // The incremental identifier is locally generated and guaranteed not derived + // from any globally unique hardware id. + // For paired devices, it stays consistent between Bluetooth toggling for the + // same remote device. + // For unpaired devices, it stays consistent within the same Bluetooth adapter + // session for the same remote device. + // Default: 0 if the device's metric id is unknown. + optional int32 metric_id = 3; } /**