Loading system/btif/src/btif_bqr.cc +13 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,8 @@ class BluetoothQualityReportInterfaceImpl; std::unique_ptr<BluetoothQualityReportInterface> bluetoothQualityReportInstance; namespace { common::PostableContext* to_bind_ = nullptr; static std::recursive_mutex life_cycle_guard_; static common::PostableContext* to_bind_ = nullptr; } void BqrVseSubEvt::ParseBqrLinkQualityEvt(uint8_t length, const uint8_t* p_param_buf) { Loading Loading @@ -385,6 +386,7 @@ void EnableBtQualityReport(common::PostableContext* to_bind) { void DisableBtQualityReport() { log::info(""); std::unique_lock<std::recursive_mutex> lock(life_cycle_guard_); if (to_bind_ == nullptr) { log::warn("Skipping second call (Lifecycle issue)."); return; Loading Loading @@ -480,6 +482,16 @@ static void BqrVscCompleteCallback(hci::CommandCompleteView complete) { return; } { // `DisableBtQualityReport()` set `to_bind_` at nullptr, after sending the command that clear // reporting. When disabled, we don't want to continue and use nulled `to_bind_` (b/365653608). std::unique_lock<std::recursive_mutex> lock(life_cycle_guard_); if (to_bind_ == nullptr) { log::info("Disabled"); return; } } if (vendor_cap_supported_version >= kBqrVndLogVersion) { command_complete_param_len = 13; } Loading Loading
system/btif/src/btif_bqr.cc +13 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,8 @@ class BluetoothQualityReportInterfaceImpl; std::unique_ptr<BluetoothQualityReportInterface> bluetoothQualityReportInstance; namespace { common::PostableContext* to_bind_ = nullptr; static std::recursive_mutex life_cycle_guard_; static common::PostableContext* to_bind_ = nullptr; } void BqrVseSubEvt::ParseBqrLinkQualityEvt(uint8_t length, const uint8_t* p_param_buf) { Loading Loading @@ -385,6 +386,7 @@ void EnableBtQualityReport(common::PostableContext* to_bind) { void DisableBtQualityReport() { log::info(""); std::unique_lock<std::recursive_mutex> lock(life_cycle_guard_); if (to_bind_ == nullptr) { log::warn("Skipping second call (Lifecycle issue)."); return; Loading Loading @@ -480,6 +482,16 @@ static void BqrVscCompleteCallback(hci::CommandCompleteView complete) { return; } { // `DisableBtQualityReport()` set `to_bind_` at nullptr, after sending the command that clear // reporting. When disabled, we don't want to continue and use nulled `to_bind_` (b/365653608). std::unique_lock<std::recursive_mutex> lock(life_cycle_guard_); if (to_bind_ == nullptr) { log::info("Disabled"); return; } } if (vendor_cap_supported_version >= kBqrVndLogVersion) { command_complete_param_len = 13; } Loading