Loading system/btif/src/btif_av.cc +5 −0 Original line number Diff line number Diff line Loading @@ -3239,6 +3239,11 @@ bt_status_t btif_av_sink_execute_service(bool enable) { BTA_AV_FEAT_METADATA | BTA_AV_FEAT_VENDOR | BTA_AV_FEAT_ADV_CTRL | BTA_AV_FEAT_RCTG | BTA_AV_FEAT_BROWSE | BTA_AV_FEAT_COVER_ARTWORK; if (delay_reporting_enabled()) { features |= BTA_AV_FEAT_DELAY_RPT; } BTA_AvEnable(features, bta_av_sink_callback); btif_av_sink.RegisterAllBtaHandles(); return BT_STATUS_SUCCESS; Loading system/stack/avdt/avdt_scb_act.cc +4 −2 Original line number Diff line number Diff line Loading @@ -840,9 +840,11 @@ void avdt_scb_hdl_tc_close(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) { * ******************************************************************************/ void avdt_scb_snd_delay_rpt_req(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) { if (p_scb->stream_config.cfg.psc_mask & AVDT_PSC_DELAY_RPT) { avdt_msg_send_cmd(p_scb->p_ccb, p_scb, AVDT_SIG_DELAY_RPT, (tAVDT_MSG*)&p_data->apidelay); } } /******************************************************************************* * Loading system/stack/test/stack_avdtp_test.cc +22 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ class StackAvdtpTest : public ::testing::Test { uint8_t event, tAVDT_CTRL* p_data, uint8_t scb_index) { mock_function_count_map[__func__]++; } static void _streamcallback(uint8_t handle, const RawAddress& bd_addr, uint8_t event, tAVDT_CTRL* p_data, uint8_t scb_index) { Loading Loading @@ -130,6 +131,8 @@ TEST_F(StackAvdtpTest, test_no_delay_report_if_not_sink) { // Get SCB ready to send response auto pscb = avdt_scb_by_hdl(scb_handle_); pscb->in_use = true; // Change the scb to SRC pscb->stream_config.tsep = AVDT_TSEP_SRC; // Send SetConfig response Loading @@ -143,6 +146,25 @@ TEST_F(StackAvdtpTest, test_no_delay_report_if_not_sink) { ASSERT_EQ(mock_function_count_map["avdt_msg_send_cmd"], 0); // Delay report command not sent } TEST_F(StackAvdtpTest, test_no_delay_report_if_not_enabled) { // Get SCB ready to send response auto pscb = avdt_scb_by_hdl(scb_handle_); pscb->in_use = true; // Disable the scb's delay report mask pscb->stream_config.cfg.psc_mask &= ~AVDT_PSC_DELAY_RPT; // Send SetConfig response uint8_t label = 0; uint8_t err_code = 0; uint8_t category = 0; mock_function_count_map["avdt_msg_send_rsp"] = 0; mock_function_count_map["avdt_msg_send_cmd"] = 0; ASSERT_EQ(AVDT_ConfigRsp(scb_handle_, label, err_code, category), AVDT_SUCCESS); ASSERT_EQ(mock_function_count_map["avdt_msg_send_rsp"], 1); // Config response sent ASSERT_EQ(mock_function_count_map["avdt_msg_send_cmd"], 0); // Delay report command not sent } TEST_F(StackAvdtpTest, test_delay_report_as_init) { auto pscb = avdt_scb_by_hdl(scb_handle_); Loading Loading
system/btif/src/btif_av.cc +5 −0 Original line number Diff line number Diff line Loading @@ -3239,6 +3239,11 @@ bt_status_t btif_av_sink_execute_service(bool enable) { BTA_AV_FEAT_METADATA | BTA_AV_FEAT_VENDOR | BTA_AV_FEAT_ADV_CTRL | BTA_AV_FEAT_RCTG | BTA_AV_FEAT_BROWSE | BTA_AV_FEAT_COVER_ARTWORK; if (delay_reporting_enabled()) { features |= BTA_AV_FEAT_DELAY_RPT; } BTA_AvEnable(features, bta_av_sink_callback); btif_av_sink.RegisterAllBtaHandles(); return BT_STATUS_SUCCESS; Loading
system/stack/avdt/avdt_scb_act.cc +4 −2 Original line number Diff line number Diff line Loading @@ -840,9 +840,11 @@ void avdt_scb_hdl_tc_close(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) { * ******************************************************************************/ void avdt_scb_snd_delay_rpt_req(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) { if (p_scb->stream_config.cfg.psc_mask & AVDT_PSC_DELAY_RPT) { avdt_msg_send_cmd(p_scb->p_ccb, p_scb, AVDT_SIG_DELAY_RPT, (tAVDT_MSG*)&p_data->apidelay); } } /******************************************************************************* * Loading
system/stack/test/stack_avdtp_test.cc +22 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ class StackAvdtpTest : public ::testing::Test { uint8_t event, tAVDT_CTRL* p_data, uint8_t scb_index) { mock_function_count_map[__func__]++; } static void _streamcallback(uint8_t handle, const RawAddress& bd_addr, uint8_t event, tAVDT_CTRL* p_data, uint8_t scb_index) { Loading Loading @@ -130,6 +131,8 @@ TEST_F(StackAvdtpTest, test_no_delay_report_if_not_sink) { // Get SCB ready to send response auto pscb = avdt_scb_by_hdl(scb_handle_); pscb->in_use = true; // Change the scb to SRC pscb->stream_config.tsep = AVDT_TSEP_SRC; // Send SetConfig response Loading @@ -143,6 +146,25 @@ TEST_F(StackAvdtpTest, test_no_delay_report_if_not_sink) { ASSERT_EQ(mock_function_count_map["avdt_msg_send_cmd"], 0); // Delay report command not sent } TEST_F(StackAvdtpTest, test_no_delay_report_if_not_enabled) { // Get SCB ready to send response auto pscb = avdt_scb_by_hdl(scb_handle_); pscb->in_use = true; // Disable the scb's delay report mask pscb->stream_config.cfg.psc_mask &= ~AVDT_PSC_DELAY_RPT; // Send SetConfig response uint8_t label = 0; uint8_t err_code = 0; uint8_t category = 0; mock_function_count_map["avdt_msg_send_rsp"] = 0; mock_function_count_map["avdt_msg_send_cmd"] = 0; ASSERT_EQ(AVDT_ConfigRsp(scb_handle_, label, err_code, category), AVDT_SUCCESS); ASSERT_EQ(mock_function_count_map["avdt_msg_send_rsp"], 1); // Config response sent ASSERT_EQ(mock_function_count_map["avdt_msg_send_cmd"], 0); // Delay report command not sent } TEST_F(StackAvdtpTest, test_delay_report_as_init) { auto pscb = avdt_scb_by_hdl(scb_handle_); Loading