Loading proto/bluetooth/metrics/bluetooth.proto +15 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,15 @@ message RFCommSession { optional int32 tx_bytes = 2; } enum A2dpSourceCodec { A2DP_SOURCE_CODEC_UNKNOWN = 0; A2DP_SOURCE_CODEC_SBC = 1; A2DP_SOURCE_CODEC_AAC = 2; A2DP_SOURCE_CODEC_APTX = 3; A2DP_SOURCE_CODEC_APTX_HD = 4; A2DP_SOURCE_CODEC_LDAC = 5; } // Session information that gets logged for A2DP session. message A2DPSession { // Media timer in milliseconds. Loading @@ -158,6 +167,12 @@ message A2DPSession { // Total audio time in this A2DP session optional int64 audio_duration_millis = 8; // Audio codec used in this A2DP session in A2DP source role optional A2dpSourceCodec source_codec = 9; // Whether A2DP offload is enabled in this A2DP session optional bool is_a2dp_offload = 10; } message PairEvent { Loading system/bta/ag/bta_ag_sco.cc +6 −0 Original line number Diff line number Diff line Loading @@ -370,6 +370,12 @@ static void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) { if (!bta_ag_sco_is_active_device(p_scb->peer_addr)) { LOG(WARNING) << __func__ << ": device " << p_scb->peer_addr << " is not active, active_device=" << active_device_addr; if (bta_ag_cb.sco.p_curr_scb != nullptr && bta_ag_cb.sco.p_curr_scb->in_use && p_scb == bta_ag_cb.sco.p_curr_scb) { do_in_bta_thread( FROM_HERE, base::Bind(&bta_ag_sm_execute, p_scb, BTA_AG_SCO_CLOSE_EVT, tBTA_AG_DATA::kEmpty)); } return; } /* Make sure this SCO handle is not already in use */ Loading system/bta/hd/bta_hd_api.cc +5 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #if defined(BTA_HD_INCLUDED) && (BTA_HD_INCLUDED == TRUE) #include <log/log.h> #include <stdio.h> #include <stdlib.h> #include <string.h> Loading Loading @@ -124,6 +125,10 @@ extern void BTA_HdRegisterApp(tBTA_HD_APP_INFO* p_app_info, p_buf->subclass = p_app_info->subclass; if (p_app_info->descriptor.dl_len > BTA_HD_APP_DESCRIPTOR_LEN) { p_app_info->descriptor.dl_len = BTA_HD_APP_DESCRIPTOR_LEN; android_errorWriteLog(0x534e4554, "113111784"); } p_buf->d_len = p_app_info->descriptor.dl_len; memcpy(p_buf->d_data, p_app_info->descriptor.dsc_list, p_app_info->descriptor.dl_len); Loading system/btif/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ cc_test { header_libs: ["libbluetooth_headers"], shared_libs: [ "libaudioclient", "android.hardware.bluetooth.a2dp@1.0", "libhidlbase", "liblog", "libprotobuf-cpp-lite", Loading @@ -132,7 +133,9 @@ cc_test { "libbtcore", "libbt-stack", "libbt-sbc-encoder", "libbt-utils", "libFraunhoferAAC", "libg722codec", "libbtdevice", "libbt-hci", "libudrv-uipc", Loading system/btif/src/btif_a2dp.cc +10 −1 Original line number Diff line number Diff line Loading @@ -88,6 +88,11 @@ bool btif_a2dp_on_started(const RawAddress& peer_addr, } ack = true; } } else { // We were started remotely if (btif_av_is_a2dp_offload_enabled()) { btif_av_stream_start_offload(); } } /* media task is autostarted upon a2dp audiopath connection */ Loading @@ -95,7 +100,11 @@ bool btif_a2dp_on_started(const RawAddress& peer_addr, } else if (pending_start) { LOG_ERROR(LOG_TAG, "%s: peer %s A2DP start request failed: status = %d", __func__, peer_addr.ToString().c_str(), p_av_start->status); if (btif_av_is_a2dp_offload_enabled()) { btif_a2dp_audio_on_started(p_av_start->status); } else { btif_a2dp_command_ack(A2DP_CTRL_ACK_FAILURE); } ack = true; } return ack; Loading Loading
proto/bluetooth/metrics/bluetooth.proto +15 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,15 @@ message RFCommSession { optional int32 tx_bytes = 2; } enum A2dpSourceCodec { A2DP_SOURCE_CODEC_UNKNOWN = 0; A2DP_SOURCE_CODEC_SBC = 1; A2DP_SOURCE_CODEC_AAC = 2; A2DP_SOURCE_CODEC_APTX = 3; A2DP_SOURCE_CODEC_APTX_HD = 4; A2DP_SOURCE_CODEC_LDAC = 5; } // Session information that gets logged for A2DP session. message A2DPSession { // Media timer in milliseconds. Loading @@ -158,6 +167,12 @@ message A2DPSession { // Total audio time in this A2DP session optional int64 audio_duration_millis = 8; // Audio codec used in this A2DP session in A2DP source role optional A2dpSourceCodec source_codec = 9; // Whether A2DP offload is enabled in this A2DP session optional bool is_a2dp_offload = 10; } message PairEvent { Loading
system/bta/ag/bta_ag_sco.cc +6 −0 Original line number Diff line number Diff line Loading @@ -370,6 +370,12 @@ static void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) { if (!bta_ag_sco_is_active_device(p_scb->peer_addr)) { LOG(WARNING) << __func__ << ": device " << p_scb->peer_addr << " is not active, active_device=" << active_device_addr; if (bta_ag_cb.sco.p_curr_scb != nullptr && bta_ag_cb.sco.p_curr_scb->in_use && p_scb == bta_ag_cb.sco.p_curr_scb) { do_in_bta_thread( FROM_HERE, base::Bind(&bta_ag_sm_execute, p_scb, BTA_AG_SCO_CLOSE_EVT, tBTA_AG_DATA::kEmpty)); } return; } /* Make sure this SCO handle is not already in use */ Loading
system/bta/hd/bta_hd_api.cc +5 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #if defined(BTA_HD_INCLUDED) && (BTA_HD_INCLUDED == TRUE) #include <log/log.h> #include <stdio.h> #include <stdlib.h> #include <string.h> Loading Loading @@ -124,6 +125,10 @@ extern void BTA_HdRegisterApp(tBTA_HD_APP_INFO* p_app_info, p_buf->subclass = p_app_info->subclass; if (p_app_info->descriptor.dl_len > BTA_HD_APP_DESCRIPTOR_LEN) { p_app_info->descriptor.dl_len = BTA_HD_APP_DESCRIPTOR_LEN; android_errorWriteLog(0x534e4554, "113111784"); } p_buf->d_len = p_app_info->descriptor.dl_len; memcpy(p_buf->d_data, p_app_info->descriptor.dsc_list, p_app_info->descriptor.dl_len); Loading
system/btif/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ cc_test { header_libs: ["libbluetooth_headers"], shared_libs: [ "libaudioclient", "android.hardware.bluetooth.a2dp@1.0", "libhidlbase", "liblog", "libprotobuf-cpp-lite", Loading @@ -132,7 +133,9 @@ cc_test { "libbtcore", "libbt-stack", "libbt-sbc-encoder", "libbt-utils", "libFraunhoferAAC", "libg722codec", "libbtdevice", "libbt-hci", "libudrv-uipc", Loading
system/btif/src/btif_a2dp.cc +10 −1 Original line number Diff line number Diff line Loading @@ -88,6 +88,11 @@ bool btif_a2dp_on_started(const RawAddress& peer_addr, } ack = true; } } else { // We were started remotely if (btif_av_is_a2dp_offload_enabled()) { btif_av_stream_start_offload(); } } /* media task is autostarted upon a2dp audiopath connection */ Loading @@ -95,7 +100,11 @@ bool btif_a2dp_on_started(const RawAddress& peer_addr, } else if (pending_start) { LOG_ERROR(LOG_TAG, "%s: peer %s A2DP start request failed: status = %d", __func__, peer_addr.ToString().c_str(), p_av_start->status); if (btif_av_is_a2dp_offload_enabled()) { btif_a2dp_audio_on_started(p_av_start->status); } else { btif_a2dp_command_ack(A2DP_CTRL_ACK_FAILURE); } ack = true; } return ack; Loading