Loading system/btif/src/btif_av.cc +16 −12 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ #include <vector> #include "audio_hal_interface/a2dp_encoding.h" #include "audio_hal_interface/hearing_aid_software_encoding.h" #include "bta/av/bta_av_int.h" #include "btif/include/btif_a2dp.h" #include "btif/include/btif_a2dp_control.h" Loading Loading @@ -2457,8 +2456,16 @@ static void btif_av_report_sink_audio_config_state( static void btif_av_query_mandatory_codec_priority( const RawAddress& peer_address) { auto query_priority = [](const RawAddress& peer_address) { if (!btif_av_source.Enabled()) { LOG_WARN("BTIF AV Source is not enabled"); return; } btav_source_callbacks_t* callbacks = btif_av_source.Callbacks(); bool preferred = callbacks != nullptr && callbacks->mandatory_codec_preferred_cb(peer_address); if (preferred) { auto apply_priority = [](const RawAddress& peer_address, bool preferred) { BtifAvPeer* peer = btif_av_source_find_peer(peer_address); BtifAvPeer* peer = btif_av_find_peer(peer_address); if (peer == nullptr) { BTIF_TRACE_WARNING( "btif_av_query_mandatory_codec_priority: peer is null"); Loading @@ -2466,9 +2473,6 @@ static void btif_av_query_mandatory_codec_priority( } peer->SetMandatoryCodecPreferred(preferred); }; bool preferred = btif_av_source.Callbacks()->mandatory_codec_preferred_cb(peer_address); if (preferred) { do_in_main_thread( FROM_HERE, base::BindOnce(apply_priority, peer_address, preferred)); } Loading system/gd/hci/acl_manager/round_robin_scheduler.cc +16 −3 Original line number Diff line number Diff line Loading @@ -205,14 +205,27 @@ void RoundRobinScheduler::incoming_acl_credits(uint16_t handle, uint16_t credits LOG_INFO("Dropping %hx received credits to unknown connection 0x%0hx", credits, handle); return; } if (acl_queue_handler->second.number_of_sent_packets_ >= credits) { acl_queue_handler->second.number_of_sent_packets_ -= credits; } else { LOG_WARN("receive more credits than we sent"); acl_queue_handler->second.number_of_sent_packets_ = 0; } if (acl_queue_handler->second.connection_type_ == ConnectionType::CLASSIC) { acl_packet_credits_ += credits; if (acl_packet_credits_ > max_acl_packet_credits_) { acl_packet_credits_ = max_acl_packet_credits_; LOG_WARN("acl packet credits overflow due to receive %hx credits", credits); } } else { le_acl_packet_credits_ += credits; if (le_acl_packet_credits_ > le_max_acl_packet_credits_) { le_acl_packet_credits_ = le_max_acl_packet_credits_; LOG_WARN("le acl packet credits overflow due to receive %hx credits", credits); } } ASSERT(acl_packet_credits_ <= max_acl_packet_credits_); ASSERT(le_acl_packet_credits_ <= le_max_acl_packet_credits_); if (acl_packet_credits_ == credits || le_acl_packet_credits_ == credits) { start_round_robin(); } Loading system/hci/src/hci_layer.cc +6 −5 Original line number Diff line number Diff line Loading @@ -180,11 +180,7 @@ void iso_data_received(BT_HDR* packet) { void hal_service_died() { if (abort_timer.IsScheduled()) { if (root_inflamed_vendor_error_code != 0 || root_inflamed_error_code != 0) { hci_root_inflamed_abort(); } else { hci_timeout_abort(); } return; } // The Bluetooth hal suddenly died and no root inflammation packet received. Loading Loading @@ -470,6 +466,11 @@ static void fragmenter_transmit_finished(BT_HDR* packet, // Abort. The chip has had time to write any debugging information. static void hci_timeout_abort(void) { if (root_inflamed_vendor_error_code != 0 || root_inflamed_error_code != 0) { hci_root_inflamed_abort(); return; } LOG_ERROR("%s restarting the Bluetooth process.", __func__); hci_close_firmware_log_file(hci_firmware_log_fd); Loading Loading
system/btif/src/btif_av.cc +16 −12 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ #include <vector> #include "audio_hal_interface/a2dp_encoding.h" #include "audio_hal_interface/hearing_aid_software_encoding.h" #include "bta/av/bta_av_int.h" #include "btif/include/btif_a2dp.h" #include "btif/include/btif_a2dp_control.h" Loading Loading @@ -2457,8 +2456,16 @@ static void btif_av_report_sink_audio_config_state( static void btif_av_query_mandatory_codec_priority( const RawAddress& peer_address) { auto query_priority = [](const RawAddress& peer_address) { if (!btif_av_source.Enabled()) { LOG_WARN("BTIF AV Source is not enabled"); return; } btav_source_callbacks_t* callbacks = btif_av_source.Callbacks(); bool preferred = callbacks != nullptr && callbacks->mandatory_codec_preferred_cb(peer_address); if (preferred) { auto apply_priority = [](const RawAddress& peer_address, bool preferred) { BtifAvPeer* peer = btif_av_source_find_peer(peer_address); BtifAvPeer* peer = btif_av_find_peer(peer_address); if (peer == nullptr) { BTIF_TRACE_WARNING( "btif_av_query_mandatory_codec_priority: peer is null"); Loading @@ -2466,9 +2473,6 @@ static void btif_av_query_mandatory_codec_priority( } peer->SetMandatoryCodecPreferred(preferred); }; bool preferred = btif_av_source.Callbacks()->mandatory_codec_preferred_cb(peer_address); if (preferred) { do_in_main_thread( FROM_HERE, base::BindOnce(apply_priority, peer_address, preferred)); } Loading
system/gd/hci/acl_manager/round_robin_scheduler.cc +16 −3 Original line number Diff line number Diff line Loading @@ -205,14 +205,27 @@ void RoundRobinScheduler::incoming_acl_credits(uint16_t handle, uint16_t credits LOG_INFO("Dropping %hx received credits to unknown connection 0x%0hx", credits, handle); return; } if (acl_queue_handler->second.number_of_sent_packets_ >= credits) { acl_queue_handler->second.number_of_sent_packets_ -= credits; } else { LOG_WARN("receive more credits than we sent"); acl_queue_handler->second.number_of_sent_packets_ = 0; } if (acl_queue_handler->second.connection_type_ == ConnectionType::CLASSIC) { acl_packet_credits_ += credits; if (acl_packet_credits_ > max_acl_packet_credits_) { acl_packet_credits_ = max_acl_packet_credits_; LOG_WARN("acl packet credits overflow due to receive %hx credits", credits); } } else { le_acl_packet_credits_ += credits; if (le_acl_packet_credits_ > le_max_acl_packet_credits_) { le_acl_packet_credits_ = le_max_acl_packet_credits_; LOG_WARN("le acl packet credits overflow due to receive %hx credits", credits); } } ASSERT(acl_packet_credits_ <= max_acl_packet_credits_); ASSERT(le_acl_packet_credits_ <= le_max_acl_packet_credits_); if (acl_packet_credits_ == credits || le_acl_packet_credits_ == credits) { start_round_robin(); } Loading
system/hci/src/hci_layer.cc +6 −5 Original line number Diff line number Diff line Loading @@ -180,11 +180,7 @@ void iso_data_received(BT_HDR* packet) { void hal_service_died() { if (abort_timer.IsScheduled()) { if (root_inflamed_vendor_error_code != 0 || root_inflamed_error_code != 0) { hci_root_inflamed_abort(); } else { hci_timeout_abort(); } return; } // The Bluetooth hal suddenly died and no root inflammation packet received. Loading Loading @@ -470,6 +466,11 @@ static void fragmenter_transmit_finished(BT_HDR* packet, // Abort. The chip has had time to write any debugging information. static void hci_timeout_abort(void) { if (root_inflamed_vendor_error_code != 0 || root_inflamed_error_code != 0) { hci_root_inflamed_abort(); return; } LOG_ERROR("%s restarting the Bluetooth process.", __func__); hci_close_firmware_log_file(hci_firmware_log_fd); Loading