1/* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18 19package android.os.statsd.bluetooth; 20 21import "frameworks/proto_logging/stats/attribution_node.proto"; 22import "frameworks/proto_logging/stats/atom_field_options.proto"; 23import "frameworks/proto_logging/stats/atoms.proto"; 24import "frameworks/proto_logging/stats/enums/bluetooth/enums.proto"; 25import "frameworks/proto_logging/stats/enums/bluetooth/hci/enums.proto"; 26import "frameworks/proto_logging/stats/enums/bluetooth/le/enums.proto"; 27import "frameworks/proto_logging/stats/enums/bluetooth/rfcomm/enums.proto"; 28 29option java_package = "com.android.os.bluetooth"; 30option java_multiple_files = true; 31 32extend Atom { 33 optional BluetoothHashedDeviceNameReported bluetooth_hashed_device_name_reported 34 = 613 [(module) = "bluetooth"]; 35 optional BluetoothL2capCocClientConnection bluetooth_l2cap_coc_client_connection 36 = 614 [(module) = "bluetooth"]; 37 optional BluetoothL2capCocServerConnection bluetooth_l2cap_coc_server_connection 38 = 615 [(module) = "bluetooth"]; 39 optional BluetoothLeSessionConnected bluetooth_le_session_connected 40 = 656 [(module) = "bluetooth"]; 41 optional RestrictedBluetoothDeviceNameReported 42 restricted_bluetooth_device_name_reported = 666 [ 43 (module) = "bt_restricted", 44 (restriction_category) = RESTRICTION_DIAGNOSTIC 45 ]; 46 optional BluetoothProfileConnectionAttempted bluetooth_profile_connection_attempted 47 = 696 [(module) = "bluetooth"]; 48 optional BluetoothContentProfileErrorReported bluetooth_content_profile_error_reported 49 = 781 [(module) = "bluetooth"]; 50 optional BluetoothRfcommConnectionAttempted bluetooth_rfcomm_connection_attempted 51 = 782 [(module) = "bluetooth"]; 52 optional RemoteDeviceInformationWithMetricId remote_device_information_with_metric_id = 862 [(module) = "bluetooth"]; 53 optional LeAppScanStateChanged le_app_scan_state_changed 54 = 870 [(module) = "bluetooth"]; 55 optional LeRadioScanStopped le_radio_scan_stopped 56 = 871 [(module) = "bluetooth"]; 57 optional LeScanResultReceived le_scan_result_received 58 = 872 [(module) = "bluetooth"]; 59 optional LeScanAbused le_scan_abused 60 = 873 [(module) = "bluetooth"]; 61 optional LeAdvStateChanged le_adv_state_changed 62 = 874 [(module) = "bluetooth"]; 63 optional LeAdvErrorReported le_adv_error_reported 64 = 875 [(module) = "bluetooth"]; 65 optional A2dpSessionReported a2dp_session_reported 66 = 904 [(module) = "bluetooth"]; 67 optional BluetoothCrossLayerEventReported bluetooth_cross_layer_event_reported 68 = 916 [(module) = "bluetooth"]; 69 optional BroadcastAudioSessionReported broadcast_audio_session_reported 70 = 927 [(module) = "bluetooth"]; 71 optional BroadcastAudioSyncReported broadcast_audio_sync_reported 72 = 928 [(module) = "bluetooth"]; 73 optional BluetoothRfcommConnectionReportedAtClose bluetooth_rfcomm_connection_reported_at_close 74 = 982 [(module) = "bluetooth"]; 75 optional BluetoothLeConnection bluetooth_le_connection 76 = 988 [(module) = "bluetooth"]; 77 optional HearingDeviceActiveEventReported hearing_device_active_event_reported 78 = 1021 [(module) = "bluetooth"]; 79} 80 81/** 82* Logs hashed Bluetooth device names 83* 84* Logged from: 85* packages/modules/Bluetooth 86*/ 87message BluetoothHashedDeviceNameReported { 88 89 // An identifier that can be used to match events for this device. 90 // The incremental identifier is locally generated and guaranteed not derived 91 // from any globally unique hardware id. 92 // For paired devices, it stays consistent between Bluetooth toggling for the 93 // same remote device. 94 // For unpaired devices, it stays consistent within the same Bluetooth adapter 95 // session for the same remote device. 96 // Default: 0 if the device's metric id is unknown. 97 optional int32 metric_id = 1; 98 99 // SHA256 hashed Bluetooth device name. 100 optional string device_name_hash = 2; 101} 102 103/** 104* Logs when L2CAP CoC on a Bluetooth device connects and disconnects. 105*/ 106message BluetoothL2capCocClientConnection { 107 108 // An identifier that can be used to match events for this device. 109 // The incremental identifier is locally generated and guaranteed not derived 110 // from any globally unique hardware id. 111 // For paired devices, it stays consistent between Bluetooth toggling for the 112 // same remote device. 113 // For unpaired devices, it stays consistent within the same Bluetooth adapter 114 // session for the same remote device. 115 // Default: 0 if the device's metric id is unknown. 116 optional int32 metric_id = 1; 117 118 // Port used for the connection session 119 optional int32 port = 2; 120 121 // Flag to show if the connection is secured or not 122 optional bool is_secured = 3; 123 124 // Result of L2CAP CoC connection 125 optional android.bluetooth.L2capCocConnectionResult result = 4; 126 127 // Latency between connection start and end 128 optional int64 connection_latency_millis = 5; 129 130 // Uid of the app who calls l2cap coc connection API 131 optional int32 uid = 6 [(is_uid) = true]; 132 133 // Latency of BluetoothSocket constructor 134 optional int64 socket_creation_latency_millis = 7; 135 136 // Latency of BluetoothSocket.connect 137 optional int64 socket_connection_latency_millis = 8; 138} 139 140/** 141* Logs when L2CAP CoC on a Bluetooth device connects and disconnects. 142*/ 143message BluetoothL2capCocServerConnection { 144 145 // An identifier that can be used to match events for this device. 146 // The incremental identifier is locally generated and guaranteed not derived 147 // from any globally unique hardware id. 148 // For paired devices, it stays consistent between Bluetooth toggling for the 149 // same remote device. 150 // For unpaired devices, it stays consistent within the same Bluetooth adapter 151 // session for the same remote device. 152 // Default: 0 if the device's metric id is unknown. 153 optional int32 metric_id = 1; 154 155 // Port used for the connection session 156 optional int32 port = 2; 157 158 // Flag to show if the connection is secured or not 159 optional bool is_secured = 3; 160 161 // Result of L2CAP CoC connection 162 optional android.bluetooth.L2capCocConnectionResult result = 4; 163 164 // Latency between connection start and end 165 optional int64 latency_since_listening_millis = 5; 166 167 // Timeout for connection acceptance. -1 if not timeout. 168 optional int64 timeout_millis = 6; 169 170 // Uid of the app who calls l2cap coc connection API 171 optional int32 uid = 7 [(is_uid) = true]; 172 173 // Latency of BluetoothServerSocket constructor 174 optional int64 socket_creation_latency_millis = 8; 175 176 // Latency of BluetoothServerSocket.accept 177 optional int64 socket_acceptance_latency_millis = 9; 178} 179 180/** 181 * Logs when Bluetooth LE Connection Session is made 182 * 183 * Logged from: system/bt 184 */ 185message BluetoothLeSessionConnected { 186 // Contains the state of the LE Connection Session 187 // Default: LE_ACL_ABSENT 188 optional android.bluetooth.le.LeAclConnectionState acl_state = 1; 189 // Origin type of the connection whether it was from the ORIGIN_JAVA 190 // or the ORIGIN_NATIVE layer 191 // Default: ORIGIN_NATIVE 192 optional android.bluetooth.le.LeConnectionOriginType connection_origin = 2; 193 // Contains the connection type whether it was CONNECTION_TYPE_GATT 194 // ,CONNECTION_TYPE_LE_ACL 195 // Default: CONNECTION_TYPE_LE_ACL 196 optional android.bluetooth.le.LeConnectionType connection_type = 3; 197 // Connection State which contain the last state associated with the 198 // event 199 // Default: STATE_UNSPECIFIED 200 optional android.bluetooth.le.LeConnectionState state = 4; 201 // Contains the latency of the transaction from the beginning till 202 // the end: 203 // Default: 0 204 optional int64 latency_nanos = 5; 205 // Contains the metric id associated with the remote device 206 // Default: 0 207 optional int32 metric_id = 6; 208 // Contains the UID which is associated with the app 209 // Default: 0 210 optional int32 app_uid = 7 [(is_uid) = true]; 211 // Contains the latency of the ACL Connection, which if made will be 212 // greater than 0 213 // Default: 0 214 optional int64 acl_latency_nanos = 8; 215 // Contains the status of the ACL Transactions, which if made will be 216 // something other than STATUS_UNKNOWN Default: STATUS_UNKNOWN 217 optional android.bluetooth.hci.StatusEnum acl_connection_state = 9; 218 // Identifies whether the LE-ACL Connection failed due to cancellation 219 // Default: false 220 optional bool is_cancelled = 10; 221} 222 223/** 224 * Logs the user created Bluetooth device's name. 225 * It is pushed at Bluetooth pairing and connection. 226 * 227 * Logged from: 228 * packages/modules/Bluetooth 229 */ 230message RestrictedBluetoothDeviceNameReported { 231 // Name of the Bluetooth device. It is created by the user. 232 optional string device_name = 1 233 [(field_restriction_option).peripheral_device_info = true]; 234} 235 236/** 237 * Logs profile connection known completions. 238 * 239 * Logged from: 240 * packages/modules/Bluetooth 241 */ 242message BluetoothProfileConnectionAttempted { 243 // The profile that is connected. Eg. GATT, A2DP, HEADSET. 244 // From android.bluetooth.BluetoothAdapter.java 245 // Default: 0 when not used 246 optional int32 bt_profile = 1; 247 248 // Result of Profile connection 249 optional android.bluetooth.ProfileConnectionResult result = 2; 250 251 // Previous connection state 252 optional android.bluetooth.ConnectionStateEnum previous_state = 3; 253 254 // Terminating connection state 255 optional android.bluetooth.ConnectionStateEnum current_state = 4; 256 257 // Reason for the connection result 258 optional android.bluetooth.ProfileConnectionReason reason = 5; 259 260 // Remote Device Information 261 optional BluetoothRemoteDeviceInformation remote_device_information = 6 [(log_mode) = MODE_BYTES]; 262} 263 264/** 265 * Logs LE connection success or failure. 266 * 267 * Logged from: 268 * packages/modules/Bluetooth 269 */ 270message BluetoothLeConnection { 271 // Result of LE connection 272 optional android.bluetooth.LeConnectionResult result = 1; 273 274 // Remote Device Information 275 optional BluetoothRemoteDeviceInformation remote_device_information = 2 [(log_mode) = MODE_BYTES]; 276} 277 278/** 279 * Logs content profiles' caught exceptions or logs (ERROR, WARN) 280 * 281 * Logged from: 282 * packages/modules/Bluetooth 283 */ 284message BluetoothContentProfileErrorReported { 285 enum ErrorType { 286 UNKNOWN = 0; 287 EXCEPTION = 1; 288 LOG_ERROR = 2; 289 LOG_WARN = 3; 290 } 291 292 // The content profile where the error happened. (E.g. PBAP, MAP, OPP) 293 // From android.bluetooth.BluetoothProfile.java 294 // Default: 0 when not used 295 optional int32 bt_profile = 1; 296 297 // The file name where the error is reported from 298 optional android.bluetooth.ContentProfileFileName file_name = 2; 299 300 // The type of error (exception, Log.e, Log.w) 301 optional ErrorType type = 3; 302 303 // Integer tag associated with the error 304 optional int32 tag = 4; 305} 306 307message BluetoothRemoteDeviceInformation { 308 // SHA256 hashed Bluetooth device name. 309 optional string allowlisted_device_name_hash = 1; 310 311 // Class of Device 312 optional int32 class_of_device = 2; 313 314 // The first three bytes of MAC address 315 optional int32 oui = 3; 316 317 // Device type metadata 318 optional android.bluetooth.RemoteDeviceTypeMetadata device_type_metadata = 4; 319} 320 321/** 322* Logs RFCOMM connection attempts 323* 324* Logged from: 325* packages/modules/Bluetooth 326*/ 327message BluetoothRfcommConnectionAttempted { 328 // Locally generated id for event matching 329 optional int32 metric_id = 1; 330 331 // Latency of the connection 332 optional int64 latency_nanos = 2; 333 334 // Whether or not the connection is secured 335 optional android.bluetooth.rfcomm.SocketConnectionSecurity security = 3; 336 337 // Result of Rfcomm connection 338 optional android.bluetooth.rfcomm.RfcommConnectionResult status = 4; 339 340 // is_serial_port is true if the service class UUID is 0x1101 341 optional bool is_serial_port = 5; 342 343 // Uid of the app that calls RFCOMM connection API 344 optional int32 uid = 6 [(is_uid) = true]; // [(datapol.semantic_type) = ST_SOFTWARE_ID] 345 346 // Remote Device Information 347 optional BluetoothRemoteDeviceInformation remote_device_information = 7 [(log_mode) = MODE_BYTES]; 348} 349 350/** 351* Logs remote device information with metric ID 352* 353* Logged from: 354* packages/modules/Bluetooth 355*/ 356message RemoteDeviceInformationWithMetricId { 357 // Locally generated id for event matching 358 optional int32 metric_id = 1; 359 360 // Remote Device Information 361 optional BluetoothRemoteDeviceInformation remote_device_information = 2 [(log_mode) = MODE_BYTES]; 362 363} 364 365/** 366 * Logs LE app scan information when the scan starts and stops. 367 * 368 * Logged from: 369 * packages/modules/Bluetooth 370*/ 371message LeAppScanStateChanged { 372 repeated AttributionNode attribution_node = 1; 373 // True for scan start, false for scan stop. 374 optional bool enabled = 2; 375 // Does the scan have a filter. 376 optional bool is_filtered = 3; 377 // Whether the scan has callback function or pending intent. 378 optional bool is_callback_scan = 4; 379 optional android.bluetooth.le.LeScanCallbackType scan_callback_type = 5; 380 optional android.bluetooth.le.LeScanType le_scan_type = 6; 381 // For app scan modes, it is logged before being modified based on screen state. 382 optional android.bluetooth.le.LeScanMode le_scan_mode = 7; 383 // Time of delay for reporting the scan result in milliseconds. 384 optional int64 report_delay_ms = 8; 385 // Duration from scan start to stop in milliseconds. Use 0 for scan start. 386 optional int64 app_scan_duration_ms = 9; 387 // Number of scans on going when the scan started or stopped. 388 optional int32 num_ongoing_scan = 10; 389 // Screen state when the scan started or stopped. True for STATE_ON, false 390 // for any other state as defined in android.view.Display. 391 optional bool is_screen_on = 11; 392 // Whether the app is dead when the scan started or stopped. 393 optional bool is_app_dead = 12; 394 // App importance compared to foreground service when the scan started or stopped. 395 optional android.bluetooth.le.AppImportance app_importance = 13; 396 // The Attribution tag to identify the last caller in the attribution chain, which could be 397 // missing in attribution_node due to incomplete attribution in the Worksource. 398 // Missing tag leads to incomplete attribution data. 399 optional string attribution_tag = 14; 400 401} 402 403/** 404 * Logs the LE scan information when the radio scan is stopped or screen state 405 * changes which reconfigures the scan parameters. 406 * 407 * Logged from: 408 * packages/modules/Bluetooth 409 */ 410message LeRadioScanStopped { 411 // Attribution of the app with most aggressive scanning parameters, which 412 // will be used by the LE radio for the scanning. 413 repeated AttributionNode attribution_node = 1; 414 optional android.bluetooth.le.LeScanType le_scan_type_most_aggressive_app = 2; 415 optional android.bluetooth.le.LeScanMode le_scan_mode_most_aggressive_app = 3; 416 // Radio scan interval in milliseconds. 417 optional int64 le_scan_radio_settings_interval_ms = 4; 418 // Radio Scan window in milliseconds. 419 optional int64 le_scan_radio_settings_window_ms = 5; 420 // True for STATE_ON, false for any other state as defined in 421 // android.view.Display. 422 optional bool is_screen_on = 6; 423 // Delta time of radio scan start and stop in milliseconds. 424 optional int64 scan_duration_ms = 7; 425 // Importance of app with most aggressive scanning parameters compared to foreground service when 426 // the radio scan started. 427 optional android.bluetooth.le.AppImportance app_importance = 8; 428 // The Attribution tag to identify the last caller in the attribution chain, which could be 429 // missing in attribution_node due to incomplete attribution in the Worksource. 430 // Missing tag leads to incomplete attribution data. 431 optional string attribution_tag = 9; 432} 433 434/** 435 * Logs the LE scan results information when regular and batched scan results 436 * are received. 437 * 438 * Logged from: 439 * packages/modules/Bluetooth 440 */ 441message LeScanResultReceived { 442 repeated AttributionNode attribution_node = 1; 443 // Number of ble scan results returned. 1 for regular scan, and use numRecords for batched scan 444 optional int32 num_results = 2; 445 optional android.bluetooth.le.LeScanType le_scan_type = 3; 446 // True for STATE_ON, false for any other state as defined in 447 // android.view.Display. 448 optional bool is_screen_on = 4; 449 // The Attribution tag to identify the last caller in the attribution chain, which could be 450 // missing in attribution_node due to incomplete attribution in the Worksource. 451 // Missing tag leads to incomplete attribution data. 452 optional string attribution_tag = 5; 453} 454 455 456/** 457 * Logs LE scan abuse count and details for scan request errors. 458 * 459 * Logged from: 460 * packages/modules/Bluetooth 461 */ 462message LeScanAbused{ 463 repeated AttributionNode attribution_node = 1; 464 optional android.bluetooth.le.LeScanType le_scan_type = 2; 465 // LE scan abuse reason. 466 optional android.bluetooth.le.LeScanAbuseReason le_scan_abuse_reason = 3; 467 // Logs the system configuration as details of the abuse reason. 468 // getScanTimeoutMillis() in AdapterService.java for REASON_SCAN_TIMEOUT. 469 // getNumOfOffloadedScanFilterSupported() in in AdapterService.java for 470 // REASON_HW_FILTER_NOT_AVAILABLE. 471 // getTotalNumOfTrackableAdvertisements() in AdapterService.java for 472 // REASON_TRACKING_HW_FILTER_NOT_AVAILABLE. 473 optional int64 le_scan_abuse_reason_details = 4; 474 // The Attribution tag to identify the last caller in the attribution chain, which could be 475 // missing in attribution_node due to incomplete attribution in the Worksource. 476 // Missing tag leads to incomplete attribution data. 477 optional string attribution_tag = 5; 478} 479 480/** 481 * Logs LE advertisement information when LE adv starts and stops. 482 * 483 * Logged from: 484 * packages/modules/Bluetooth 485 */ 486message LeAdvStateChanged { 487 repeated AttributionNode attribution_node = 1; 488 // LE advertisement state, true for adv start, false for adv stop. 489 optional bool enabled = 2; 490 // LE adv interval configuration. 491 optional android.bluetooth.le.LeAdvInterval adv_interval = 3; 492 // LE adv tx power configuration. 493 optional android.bluetooth.le.LeAdvTxPower adv_tx_power = 4; 494 // Whether the adv is connectable. 495 optional bool is_connectable = 5; 496 // Whether the adv is periodic. 497 optional bool is_periodic = 6; 498 // Whether the adv has scan response. 499 optional bool has_scan_response = 7; 500 // Whether the adv is extended adv. 501 optional bool is_extended_adv = 8; 502 // Number of total active advertisements when the current advertisement 503 // starts or stops. 504 optional int32 num_adv_instances_in_use = 9; 505 // Adv duration when adv stops (adv stop timestamp - adv start timestamp), 506 // in milliseconds. Use 0 for adv start. 507 optional int64 adv_duration_ms = 10; 508 // App importance compared to foreground service when the advertisement started or stopped. 509 optional android.bluetooth.le.AppImportance app_importance = 11; 510 // The Attribution tag to identify the last caller in the attribution chain, which could be 511 // missing in attribution_node due to incomplete attribution in the Worksource. 512 // Missing tag leads to incomplete attribution data. 513 optional string attribution_tag = 12; 514} 515 516/** 517 * Logs errors when LE advertising set starts. 518 * 519 * Logged from: 520 * packages/modules/Bluetooth 521 */ 522message LeAdvErrorReported { 523 repeated AttributionNode attribution_node = 1; 524 // Operation code for the adv error. 525 optional android.bluetooth.le.LeAdvOpCode le_adv_op_code = 2; 526 // The status code of internal state. 527 optional android.bluetooth.le.LeAdvStatusCode status_code = 3; 528 // The Attribution tag to identify the last caller in the attribution chain, which could be 529 // missing in attribution_node due to incomplete attribution in the Worksource. 530 // Missing tag leads to incomplete attribution data. 531 optional string attribution_tag = 4; 532} 533 534/** 535 * Logs A2DP session information when the session ends. 536 * 537 * Logged from: 538 * packages/modules/Bluetooth 539 */ 540message A2dpSessionReported { 541 // Full duration of the session in milliseconds. 542 optional int64 duration_ms = 1; 543 // Minimum duration of the media timer in milliseconds. 544 optional int32 min_timer_duration_ms = 2; 545 // Maximum duration of the media timer in milliseconds. 546 optional int32 max_timer_duration_ms = 3; 547 // Average duration of the media timer in milliseconds. 548 optional int32 average_timer_duration_ms = 4; 549 // Total number of times the media timer was scheduled. 550 optional int32 total_scheduling_count = 5; 551 // Counts the maximum number of audio frames dropped simultaneously due 552 // to TX buffer overruns during the session. 553 optional int32 max_buffer_overrun = 6; 554 // Counts the total number of audio frames that were dropped due to TX buffer 555 // overruns during the session. 556 optional int32 total_buffer_overrun = 7; 557 // Counts the average number of bytes of underflow when reading fromt the 558 // PCM audio stream. 559 optional float average_buffer_underrun = 8; 560 // Total number of bytes of underflow when reading from the PCM audio stream. 561 optional int32 total_buffer_underrun = 9; 562 // Unique identifier of the codec used for the session. The codec identifier 563 // is 40 bits, 564 // - Bits 0-7: Audio Codec ID, as defined by [ID 6.5.1] 565 // 0x00: SBC 566 // 0x02: AAC 567 // 0xFF: Vendor 568 // - Bits 8-23: Company ID, set to 0, if octet 0 is not 0xFF. 569 // - Bits 24-39: Vendor-defined codec ID, set to 0, if octet 0 is not 0xFF. 570 optional int64 codec_id = 10; 571 // Indicates whether the session is offloaded or not. 572 optional bool offload = 11; 573 // Identifier for the remote device. 574 optional int32 metric_id = 12; 575} 576 577/** 578 * Logs a Bluetooth Event 579 * 580 * Logged from: 581 * packages/modules/Bluetooth 582*/ 583message BluetoothCrossLayerEventReported { 584 // Type of Bluetooth Event 585 optional android.bluetooth.EventType event_type = 1; 586 587 // Addition Details about the event, specific to the event type 588 optional android.bluetooth.State state = 2; 589 590 // Identifier for the app that initiates the CUJ (if applicable) 591 optional int32 uid = 3 [(is_uid) = true]; 592 593 // Identifier for the remote device/metric id 594 optional int32 metric_id = 4; 595 596 // Remote Device Information 597 optional BluetoothRemoteDeviceInformation remote_device_information = 5 598 [(log_mode) = MODE_BYTES]; 599} 600 601/** 602 * Logs LE Audio Broadcast Audio Session 603 * 604 * Logged from: 605 * packages/modules/Bluetooth 606*/ 607message BroadcastAudioSessionReported { 608 // Identifier randomly generated for every broadcast session 609 // Default: -1 if the broadcast id is unknown 610 optional int32 broadcast_id = 1; 611 612 // Number of audio groups in this broadcast session 613 optional int32 audio_group_size = 2; 614 615 // Broadcast audio quality configuration for all subgroups 616 repeated android.bluetooth.BroadcastAudioQualityType audio_quality = 3; 617 618 // Number of devices in this broadcast session 619 optional int32 group_size = 4; 620 621 // Broadcast session duration 622 optional int64 duration_ms = 5; 623 624 // Broadcast session in configured state latency 625 optional int64 latency_broadcast_configured_ms = 6; 626 627 // Broadcast session in streaming state latency 628 optional int64 latency_broadcast_streaming_ms = 7; 629 630 // Status of broadcast session setup 631 optional android.bluetooth.BroadcastSessionSetupStatus session_setup_status = 8; 632} 633 634/** 635 * Logs LE Audio Broadcast Audio Sync 636 * 637 * Logged from: 638 * packages/modules/Bluetooth 639*/ 640message BroadcastAudioSyncReported { 641 // Identifier randomly generated for every broadcast session 642 // Default: -1 if the broadcast id is unknown 643 optional int32 broadcast_id = 1; 644 645 // Local broadcast or external broadcast 646 optional bool is_local_broadcast = 2; 647 648 // Broadcast session duration 649 optional int64 duration_ms = 3; 650 651 // Latency from adding source to PA synced 652 optional int64 latency_pa_sync_ms = 4; 653 654 // Latency from adding source to BIS synced 655 optional int64 latency_bis_sync_ms = 5; 656 657 // Status of broadcast sync 658 optional android.bluetooth.BroadcastSyncStatus sync_status = 6; 659 660 // Remote Device Information 661 optional BluetoothRemoteDeviceInformation remote_device_information = 7 [(log_mode) = MODE_BYTES]; 662} 663 664/** 665 * Logs RFCOMM connection attempts from the native layer after the connection closes 666 * 667 * Logged from: 668 * packages/modules/Bluetooth 669 * 670 * Estimated Logging Rate: 671 * Peak: 5 times in 30 seconds | Avg: 4 per device per day 672 * 673*/ 674message BluetoothRfcommConnectionReportedAtClose { 675 // Reason for error or closure 676 optional android.bluetooth.rfcomm.PortResult close_reason = 1; 677 // security level of the connection 678 optional android.bluetooth.rfcomm.SocketConnectionSecurity security = 2; 679 // last event processed by port state machine 680 optional android.bluetooth.rfcomm.RfcommPortEvent last_event = 3; 681 // state prior to "CLOSED" 682 optional android.bluetooth.rfcomm.RfcommPortState previous_state = 4; 683 // duration that the socket was opened, 0 if connection failed 684 optional int32 open_duration_ms = 5; 685 // uid of the app that called connect 686 optional int32 uid = 6 [(is_uid) = true]; 687 // locally generated id for event matching 688 optional int32 metric_id = 7; 689 // sdp status, UNKNOWN if irrelevant 690 optional android.bluetooth.BtaStatus sdp_status = 8; 691 // true if device initiated connection as server, false otherwise 692 optional bool is_server = 9; 693 // true if device initiated SDP service discovery 694 optional bool sdp_initiated = 10; 695 // time in milliseconds between start and end of SDP, 0 if no SDP 696 optional int32 sdp_duration_ms = 11; 697} 698 699/** 700 * Logs hearing devices active event when profiles connected. 701 * 702 * Logged from: 703 * packages/modules/Bluetooth 704 * 705 * Estimated Logging Rate: 706 * Peak: 3 times in 1 day | Avg: 1 per device per day 707*/ 708message HearingDeviceActiveEventReported { 709 enum DeviceType { 710 UNKNOWN_TYPE = 0; 711 CLASSIC = 1; 712 ASHA = 2; 713 LE_AUDIO = 3; 714 } 715 enum TimePeriod { 716 UNKNOWN_TIME_PERIOD = 0; 717 DAY = 1; 718 WEEK = 2; 719 MONTH = 3; 720 } 721 // The type of the hearing device 722 optional DeviceType device_type = 1; 723 // The time period of the active event 724 optional TimePeriod time_period = 2; 725 // Remote Device Information 726 optional BluetoothRemoteDeviceInformation remote_device_information = 3 [(log_mode) = MODE_BYTES]; 727} 728