Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52a1876f authored by Sam Chiu's avatar Sam Chiu Committed by Gerrit Code Review
Browse files

Merge changes from topic "revert-3074206-HETWXZTPUZ" into main

* changes:
  Revert "Copy BTM Quality code to btif"
  Revert "Add tests for BQR Events"
  Revert "BQR: Make internal functions static"
  Revert "BQR: Remove BTM layer remnants"
parents 1be5daa2 9f48cdf8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -735,7 +735,6 @@ cc_test {
        "libbluetooth-types",
        "libbluetooth_crypto_toolbox",
        "libbluetooth_gd",
        "libbluetooth_hci_pdl",
        "libbluetooth_log",
        "libbt-audio-hal-interface",
        "libbt-btu-main-thread",
@@ -753,7 +752,6 @@ cc_test {
        "libchrome",
        "libcom.android.sysprop.bluetooth.wrapped",
        "libevent",
        "libflatbuffers-cpp",
        "libgmock",
        "libprotobuf-cpp-lite",
        "libstatslog_bt",
+76 −4
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@

#include <bluetooth/log.h>

#include "common/postable_context.h"
#include "hci/hci_packets.h"
#include "btm_api_types.h"
#include "common/leaky_bonded_queue.h"
#include "include/hardware/bt_bqr.h"
#include "osi/include/osi.h"
#include "raw_address.h"
@@ -393,6 +393,18 @@ class BqrVseSubEvt {

BluetoothQualityReportInterface* getBluetoothQualityReportInterface();

// Get a string representation of the Quality Report ID.
//
// @param quality_report_id The quality report ID to convert.
// @return a string representation of the Quality Report ID.
std::string QualityReportIdToString(uint8_t quality_report_id);

// Get a string representation of the Packet Type.
//
// @param packet_type The packet type to convert.
// @return a string representation of the Packet Type.
std::string PacketTypeToString(uint8_t packet_type);

// Enable/Disable Bluetooth Quality Report mechanism.
//
// Which Quality event will be enabled is according to the setting of the
@@ -400,8 +412,68 @@ BluetoothQualityReportInterface* getBluetoothQualityReportInterface();
// And the minimum time interval of quality event reporting depends on the
// setting of property "persist.bluetooth.bqr.min_interval_ms".
//
// @param to_bind gives the postable for the callback, or null if disabling.
void EnableBtQualityReport(common::PostableContext* to_bind);
// @param is_enable True/False to enable/disable Bluetooth Quality Report
//   mechanism in the Bluetooth controller.
void EnableBtQualityReport(bool is_enable);

// Configure Bluetooth Quality Report setting to the Bluetooth controller.
//
// @param bqr_config The struct of configuration parameters.
void ConfigureBqr(const BqrConfiguration& bqr_config);

// Callback invoked on completion of vendor specific Bluetooth Quality Report
// command.
//
// @param p_vsc_cmpl_params A pointer to the parameters contained in the vendor
//   specific command complete event.
void BqrVscCompleteCallback(tBTM_VSC_CMPL* p_vsc_cmpl_params);

// Invoked on completion of Bluetooth Quality Report configuration. Then it will
// Register/Unregister for receiving VSE - Bluetooth Quality Report sub-event.
//
// @param current_evt_mask Indicates current quality event bit mask setting in
//   the Bluetooth controller.
void ConfigureBqrCmpl(uint32_t current_evt_mask);

// Categorize the incoming Bluetooth Quality Report.
//
// @param length Lengths of the quality report sent from the Bluetooth
//   controller.
// @param p_bqr_event A pointer to the BQR VSE sub-event which is sent from the
//   Bluetooth controller.
void CategorizeBqrEvent(uint8_t length, const uint8_t* p_bqr_event);

// Record a new incoming Link Quality related BQR event in quality event queue.
//
// @param length Lengths of the Link Quality related BQR event.
// @param p_link_quality_event A pointer to the Link Quality related BQR event.
void AddLinkQualityEventToQueue(uint8_t length,
                                const uint8_t* p_link_quality_event);

// Dump the LMP/LL message handshaking with the remote device to a log file.
//
// @param length Lengths of the LMP/LL message trace event.
// @param p_lmp_ll_message_event A pointer to the LMP/LL message trace event.
void DumpLmpLlMessage(uint8_t length, const uint8_t* p_lmp_ll_message_event);

// Open the LMP/LL message trace log file.
//
// @return a file descriptor of the LMP/LL message trace log file.
int OpenLmpLlTraceLogFile();

// Dump the Bluetooth Multi-profile/Coex scheduling information to a log file.
//
// @param length Lengths of the Bluetooth Multi-profile/Coex scheduling trace
//   event.
// @param p_bt_scheduling_event A pointer to the Bluetooth Multi-profile/Coex
//   scheduling trace event.
void DumpBtScheduling(uint8_t length, const uint8_t* p_bt_scheduling_event);

// Open the Bluetooth Multi-profile/Coex scheduling trace log file.
//
// @return a file descriptor of the Bluetooth Multi-profile/Coex scheduling
//   trace log file.
int OpenBtSchedulingTraceLogFile();

// Dump Bluetooth Quality Report information.
//
+54 −192
Original line number Diff line number Diff line
@@ -14,36 +14,30 @@
 * limitations under the License.
 */

#include <bluetooth/log.h>
#include <fcntl.h>
#ifdef __ANDROID__
#include <statslog_bt.h>
#endif
#include <bluetooth/log.h>
#include <sys/stat.h>

#include <cerrno>
#include <cstdint>

#include "btif/include/stack_manager_t.h"
#include "btif_bqr.h"
#include "btif_common.h"
#include "btif_storage.h"
#include "btm_api.h"
#include "btm_ble_api.h"
#include "common/init_flags.h"
#include "common/leaky_bonded_queue.h"
#include "common/postable_context.h"
#include "common/time_util.h"
#include "core_callbacks.h"
#include "hci/hci_interface.h"
#include "hci/hci_packets.h"
#include "hci/vendor_specific_event_manager_interface.h"
#include "internal_include/bt_trace.h"
#include "main/shim/entry.h"
#include "osi/include/properties.h"
#include "packet/raw_builder.h"
#include "raw_address.h"
#include "stack/btm/btm_dev.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_api.h"
#include "stack/include/btm_ble_api.h"

namespace bluetooth {
namespace bqr {
@@ -52,17 +46,14 @@ using bluetooth::common::LeakyBondedQueue;
using std::chrono::system_clock;

// The instance of BQR event queue
static std::unique_ptr<LeakyBondedQueue<BqrVseSubEvt>> kpBqrEventQueue;
static std::unique_ptr<LeakyBondedQueue<BqrVseSubEvt>> kpBqrEventQueue(
    new LeakyBondedQueue<BqrVseSubEvt>(kBqrEventQueueSize));

static uint16_t vendor_cap_supported_version;

class BluetoothQualityReportInterfaceImpl;
std::unique_ptr<BluetoothQualityReportInterface> bluetoothQualityReportInstance;

namespace {
common::PostableContext* to_bind_ = nullptr;
}

void BqrVseSubEvt::ParseBqrLinkQualityEvt(uint8_t length,
                                          const uint8_t* p_param_buf) {
  if (length < kLinkQualityParamTotalLen) {
@@ -198,9 +189,6 @@ void BqrVseSubEvt::WriteBtSchedulingTraceLogFile(int fd, uint8_t length,
  BtSchedulingTraceCounter++;
}

static std::string QualityReportIdToString(uint8_t quality_report_id);
static std::string PacketTypeToString(uint8_t packet_type);

std::string BqrVseSubEvt::ToString() const {
  std::stringstream ss;
  ss << QualityReportIdToString(bqr_link_quality_event_.quality_report_id)
@@ -248,11 +236,7 @@ std::string BqrVseSubEvt::ToString() const {
  return ss.str();
}

// Get a string representation of the Quality Report ID.
//
// @param quality_report_id The quality report ID to convert.
// @return a string representation of the Quality Report ID.
static std::string QualityReportIdToString(uint8_t quality_report_id) {
std::string QualityReportIdToString(uint8_t quality_report_id) {
  switch (quality_report_id) {
    case QUALITY_REPORT_ID_MONITOR_MODE:
      return "Monitoring";
@@ -271,11 +255,7 @@ static std::string QualityReportIdToString(uint8_t quality_report_id) {
  }
}

// Get a string representation of the Packet Type.
//
// @param packet_type The packet type to convert.
// @return a string representation of the Packet Type.
static std::string PacketTypeToString(uint8_t packet_type) {
std::string PacketTypeToString(uint8_t packet_type) {
  switch (packet_type) {
    case PACKET_TYPE_ID:
      return "ID";
@@ -340,16 +320,8 @@ static std::string PacketTypeToString(uint8_t packet_type) {
  }
}

void register_vse();
void unregister_vse();

static void ConfigureBqr(const BqrConfiguration& bqr_config);

void EnableBtQualityReport(common::PostableContext* to_bind) {
  log::info("is_enable: {}", to_bind != nullptr);
  if (to_bind != nullptr) {
    to_bind_ = to_bind;
  }
void EnableBtQualityReport(bool is_enable) {
  log::info("is_enable: {}", is_enable);

  char bqr_prop_evtmask[PROPERTY_VALUE_MAX] = {0};
  char bqr_prop_interval_ms[PROPERTY_VALUE_MAX] = {0};
@@ -372,7 +344,7 @@ void EnableBtQualityReport(common::PostableContext* to_bind) {

  BqrConfiguration bqr_config = {};

  if (to_bind) {
  if (is_enable) {
    bqr_config.report_action = REPORT_ACTION_ADD;
    bqr_config.quality_event_mask =
        static_cast<uint32_t>(atoi(bqr_prop_evtmask));
@@ -384,9 +356,6 @@ void EnableBtQualityReport(common::PostableContext* to_bind) {
        static_cast<uint32_t>(atoi(bqr_prop_vnd_trace_mask));
    bqr_config.report_interval_multiple =
        static_cast<uint32_t>(atoi(bqr_prop_interval_multiple));
    register_vse();
    kpBqrEventQueue =
        std::make_unique<LeakyBondedQueue<BqrVseSubEvt>>(kBqrEventQueueSize);
  } else {
    bqr_config.report_action = REPORT_ACTION_CLEAR;
    bqr_config.quality_event_mask = kQualityEventMaskAllOff;
@@ -394,7 +363,6 @@ void EnableBtQualityReport(common::PostableContext* to_bind) {
    bqr_config.vnd_quality_mask = 0;
    bqr_config.vnd_trace_mask = 0;
    bqr_config.report_interval_multiple = 0;
    unregister_vse();
  }

  tBTM_BLE_VSC_CB cmn_vsc_cb;
@@ -409,11 +377,6 @@ void EnableBtQualityReport(common::PostableContext* to_bind) {
  ConfigureBqr(bqr_config);
}

static void BqrVscCompleteCallback(hci::CommandCompleteView complete);

// Configure Bluetooth Quality Report setting to the Bluetooth controller.
//
// @param bqr_config The struct of configuration parameters.
void ConfigureBqr(const BqrConfiguration& bqr_config) {
  if (vendor_cap_supported_version >= kBqrVersion6_0) {
    if (bqr_config.report_action > REPORT_ACTION_QUERY ||
@@ -444,40 +407,24 @@ void ConfigureBqr(const BqrConfiguration& bqr_config) {
            bqr_config.minimum_report_interval_ms,
            bqr_config.report_interval_multiple);

  auto payload = std::make_unique<packet::RawBuilder>();
  payload->AddOctets1(bqr_config.report_action);
  payload->AddOctets4(bqr_config.quality_event_mask);
  payload->AddOctets2(bqr_config.minimum_report_interval_ms);
  uint8_t param[sizeof(BqrConfiguration)];
  uint8_t* p_param = param;
  UINT8_TO_STREAM(p_param, bqr_config.report_action);
  UINT32_TO_STREAM(p_param, bqr_config.quality_event_mask);
  UINT16_TO_STREAM(p_param, bqr_config.minimum_report_interval_ms);
  if (vendor_cap_supported_version >= kBqrVndLogVersion) {
    payload->AddOctets4(bqr_config.vnd_quality_mask);
    payload->AddOctets4(bqr_config.vnd_trace_mask);
    UINT32_TO_STREAM(p_param, bqr_config.vnd_quality_mask);
    UINT32_TO_STREAM(p_param, bqr_config.vnd_trace_mask);
  }
  if (vendor_cap_supported_version >= kBqrVersion6_0) {
    payload->AddOctets4(bqr_config.report_interval_multiple);
    UINT32_TO_STREAM(p_param, bqr_config.report_interval_multiple);
  }

  shim::GetHciLayer()->EnqueueCommand(
      hci::CommandBuilder::Create(hci::OpCode::CONTROLLER_BQR,
                                  std::move(payload)),
      to_bind_->BindOnce(BqrVscCompleteCallback));
  BTM_VendorSpecificCommand(HCI_CONTROLLER_BQR, p_param - param, param,
                            BqrVscCompleteCallback);
}

static void ConfigureBqrCmpl(uint32_t current_evt_mask);

// Callback invoked on completion of vendor specific Bluetooth Quality Report
// command.
//
// @param p_vsc_cmpl_params A pointer to the parameters contained in the vendor
//   specific command complete event.
static void BqrVscCompleteCallback(hci::CommandCompleteView complete) {
  std::vector<uint8_t> payload_vector{complete.GetPayload().begin(),
                                      complete.GetPayload().end()};
  tBTM_VSC_CMPL vsc_cmpl_params = {
      .opcode = static_cast<uint16_t>(complete.GetCommandOpCode()),
      .param_len = static_cast<uint16_t>(payload_vector.size()),
      .p_param_buf = payload_vector.data()};
  tBTM_VSC_CMPL* p_vsc_cmpl_params = &vsc_cmpl_params;

void BqrVscCompleteCallback(tBTM_VSC_CMPL* p_vsc_cmpl_params) {
  if (p_vsc_cmpl_params->param_len < 1) {
    log::error("The length of returned parameters is less than 1");
    return;
@@ -538,7 +485,9 @@ static void BqrVscCompleteCallback(hci::CommandCompleteView complete) {
}

void ConfigBqrA2dpScoThreshold() {
  uint8_t param[20] = {0};
  uint8_t sub_opcode = 0x16;
  uint8_t* p_param = param;
  uint16_t a2dp_choppy_threshold = 0;
  uint16_t sco_choppy_threshold = 0;

@@ -548,44 +497,47 @@ void ConfigBqrA2dpScoThreshold() {
  sscanf(bqr_prop_threshold, "%hu,%hu", &a2dp_choppy_threshold,
         &sco_choppy_threshold);

  log::info("a2dp_choppy_threshold: {}, sco_choppy_threshold: {}",
  log::warn("a2dp_choppy_threshold: {}, sco_choppy_threshold: {}",
            a2dp_choppy_threshold, sco_choppy_threshold);

  auto payload = std::make_unique<packet::RawBuilder>();
  payload->AddOctets1(sub_opcode);
  UINT8_TO_STREAM(p_param, sub_opcode);

  // A2dp glitch ID
  payload->AddOctets1(QUALITY_REPORT_ID_A2DP_AUDIO_CHOPPY);
  UINT8_TO_STREAM(p_param, QUALITY_REPORT_ID_A2DP_AUDIO_CHOPPY);
  // A2dp glitch config data length
  payload->AddOctets1(2);
  UINT8_TO_STREAM(p_param, 2);
  // A2dp glitch threshold
  payload->AddOctets2(a2dp_choppy_threshold == 0 ? 1 : a2dp_choppy_threshold);
  UINT16_TO_STREAM(p_param,
                   a2dp_choppy_threshold == 0 ? 1 : a2dp_choppy_threshold);

  // Sco glitch ID
  payload->AddOctets1(QUALITY_REPORT_ID_SCO_VOICE_CHOPPY);
  UINT8_TO_STREAM(p_param, QUALITY_REPORT_ID_SCO_VOICE_CHOPPY);
  // Sco glitch config data length
  payload->AddOctets1(2);
  UINT8_TO_STREAM(p_param, 2);
  // Sco glitch threshold
  payload->AddOctets2(sco_choppy_threshold == 0 ? 1 : sco_choppy_threshold);
  UINT16_TO_STREAM(p_param,
                   sco_choppy_threshold == 0 ? 1 : sco_choppy_threshold);

  shim::GetHciLayer()->EnqueueCommand(
      hci::CommandBuilder::Create(
          static_cast<hci::OpCode>(HCI_VS_HOST_LOG_OPCODE), std::move(payload)),
      to_bind_->BindOnce([](hci::CommandCompleteView) {}));
  BTM_VendorSpecificCommand(HCI_VS_HOST_LOG_OPCODE, p_param - param, param,
                            NULL);
}

// Invoked on completion of Bluetooth Quality Report configuration. Then it will
// Register/Unregister for receiving VSE - Bluetooth Quality Report sub-event.
//
// @param current_evt_mask Indicates current quality event bit mask setting in
//   the Bluetooth controller.
static void ConfigureBqrCmpl(uint32_t current_evt_mask) {
void ConfigureBqrCmpl(uint32_t current_evt_mask) {
  log::info("current_evt_mask: 0x{:x}", current_evt_mask);
  // (Un)Register for VSE of Bluetooth Quality Report sub event
  tBTM_STATUS btm_status = BTM_BT_Quality_Report_VSE_Register(
      current_evt_mask > kQualityEventMaskAllOff, CategorizeBqrEvent);

  if (current_evt_mask > kQualityEventMaskAllOff) {
    ConfigBqrA2dpScoThreshold();
  }

  if (btm_status != BTM_SUCCESS) {
    log::error("Fail to (un)register VSE of BQR sub event. status: {}",
               btm_status);
    return;
  }

  if (LmpLlMessageTraceLogFd != INVALID_FD &&
      (current_evt_mask & kQualityEventMaskLmpMessageTrace) == 0) {
    log::info("Closing LMP/LL log file.");
@@ -600,15 +552,7 @@ static void ConfigureBqrCmpl(uint32_t current_evt_mask) {
  }
}

static void AddLinkQualityEventToQueue(uint8_t length,
                                       const uint8_t* p_link_quality_event);
// Categorize the incoming Bluetooth Quality Report.
//
// @param length Lengths of the quality report sent from the Bluetooth
//   controller.
// @param p_bqr_event A pointer to the BQR VSE sub-event which is sent from the
//   Bluetooth controller.
static void CategorizeBqrEvent(uint8_t length, const uint8_t* p_bqr_event) {
void CategorizeBqrEvent(uint8_t length, const uint8_t* p_bqr_event) {
  if (length == 0) {
    log::warn("Lengths of all of the parameters are zero.");
    return;
@@ -650,17 +594,14 @@ static void CategorizeBqrEvent(uint8_t length, const uint8_t* p_bqr_event) {
  }
}

// Record a new incoming Link Quality related BQR event in quality event queue.
//
// @param length Lengths of the Link Quality related BQR event.
// @param p_link_quality_event A pointer to the Link Quality related BQR event.
static void AddLinkQualityEventToQueue(uint8_t length,
void AddLinkQualityEventToQueue(uint8_t length,
                                const uint8_t* p_link_quality_event) {
  std::unique_ptr<BqrVseSubEvt> p_bqr_event = std::make_unique<BqrVseSubEvt>();
  RawAddress bd_addr;

  p_bqr_event->ParseBqrLinkQualityEvt(length, p_link_quality_event);

  log::warn("{}", *p_bqr_event);
  GetInterfaceToProfiles()->events->invoke_link_quality_report_cb(
      bluetooth::common::time_get_os_boottime_ms(),
      p_bqr_event->bqr_link_quality_event_.quality_report_id,
@@ -724,14 +665,7 @@ static void AddLinkQualityEventToQueue(uint8_t length,
  kpBqrEventQueue->Enqueue(p_bqr_event.release());
}

static int OpenLmpLlTraceLogFile();

// Dump the LMP/LL message handshaking with the remote device to a log file.
//
// @param length Lengths of the LMP/LL message trace event.
// @param p_lmp_ll_message_event A pointer to the LMP/LL message trace event.
static void DumpLmpLlMessage(uint8_t length,
                             const uint8_t* p_lmp_ll_message_event) {
void DumpLmpLlMessage(uint8_t length, const uint8_t* p_lmp_ll_message_event) {
  std::unique_ptr<BqrVseSubEvt> p_bqr_event = std::make_unique<BqrVseSubEvt>();

  if (LmpLlMessageTraceLogFd == INVALID_FD ||
@@ -744,10 +678,7 @@ static void DumpLmpLlMessage(uint8_t length,
  }
}

// Open the LMP/LL message trace log file.
//
// @return a file descriptor of the LMP/LL message trace log file.
static int OpenLmpLlTraceLogFile() {
int OpenLmpLlTraceLogFile() {
  if (rename(kpLmpLlMessageTraceLogPath, kpLmpLlMessageTraceLastLogPath) != 0 &&
      errno != ENOENT) {
    log::error("Unable to rename '{}' to '{}' : {}", kpLmpLlMessageTraceLogPath,
@@ -768,16 +699,7 @@ static int OpenLmpLlTraceLogFile() {
  return logfile_fd;
}

static int OpenBtSchedulingTraceLogFile();

// Dump the Bluetooth Multi-profile/Coex scheduling information to a log file.
//
// @param length Lengths of the Bluetooth Multi-profile/Coex scheduling trace
//   event.
// @param p_bt_scheduling_event A pointer to the Bluetooth Multi-profile/Coex
//   scheduling trace event.
static void DumpBtScheduling(uint8_t length,
                             const uint8_t* p_bt_scheduling_event) {
void DumpBtScheduling(uint8_t length, const uint8_t* p_bt_scheduling_event) {
  std::unique_ptr<BqrVseSubEvt> p_bqr_event = std::make_unique<BqrVseSubEvt>();

  if (BtSchedulingTraceLogFd == INVALID_FD ||
@@ -790,11 +712,7 @@ static void DumpBtScheduling(uint8_t length,
  }
}

// Open the Bluetooth Multi-profile/Coex scheduling trace log file.
//
// @return a file descriptor of the Bluetooth Multi-profile/Coex scheduling
//   trace log file.
static int OpenBtSchedulingTraceLogFile() {
int OpenBtSchedulingTraceLogFile() {
  if (rename(kpBtSchedulingTraceLogPath, kpBtSchedulingTraceLastLogPath) != 0 &&
      errno != ENOENT) {
    log::error("Unable to rename '{}' to '{}' : {}", kpBtSchedulingTraceLogPath,
@@ -941,61 +859,5 @@ BluetoothQualityReportInterface* getBluetoothQualityReportInterface() {
  return bluetoothQualityReportInstance.get();
}

static void vendor_specific_event_callback(
    hci::VendorSpecificEventView vendor_specific_event_view) {
  auto bqr = hci::BqrEventView::CreateOptional(vendor_specific_event_view);
  if (!bqr) {
    return;
  }
  auto payload = vendor_specific_event_view.GetPayload();
  std::vector<uint8_t> bytes{payload.begin(), payload.end()};

  uint8_t quality_report_id = static_cast<uint8_t>(bqr->GetQualityReportId());
  uint8_t bqr_parameter_length = bytes.size();
  const uint8_t* p_bqr_event = bytes.data();

  // The stream currently points to the BQR sub-event parameters
  switch (quality_report_id) {
    case bluetooth::bqr::QUALITY_REPORT_ID_LMP_LL_MESSAGE_TRACE: {
      auto lmp_view = hci::BqrLogDumpEventView::Create(*bqr);
    }
      if (bqr_parameter_length >= bluetooth::bqr::kLogDumpParamTotalLen) {
        bluetooth::bqr::DumpLmpLlMessage(bqr_parameter_length, p_bqr_event);
      } else {
        log::info("Malformed LMP event of length {}", bqr_parameter_length);
      }

      break;

    case bluetooth::bqr::QUALITY_REPORT_ID_BT_SCHEDULING_TRACE:
      if (bqr_parameter_length >= bluetooth::bqr::kLogDumpParamTotalLen) {
        bluetooth::bqr::DumpBtScheduling(bqr_parameter_length, p_bqr_event);
      } else {
        log::info("Malformed TRACE event of length {}", bqr_parameter_length);
      }
      break;

    default:
      log::info("Unhandled BQR subevent 0x{:02x}", quality_report_id);
  }

  CategorizeBqrEvent(bytes.size(), bytes.data());
}

void register_vse() {
  bluetooth::shim::GetVendorSpecificEventManager()->RegisterEventHandler(
      hci::VseSubeventCode::BQR_EVENT,
      to_bind_->Bind(vendor_specific_event_callback));
}

void unregister_vse() {
  bluetooth::shim::GetVendorSpecificEventManager()->UnregisterEventHandler(
      hci::VseSubeventCode::BQR_EVENT);
}

namespace testing {
void set_lmp_trace_log_fd(int fd) { LmpLlMessageTraceLogFd = fd; }
}  // namespace testing

}  // namespace bqr
}  // namespace bluetooth
+2 −2
Original line number Diff line number Diff line
@@ -2167,7 +2167,7 @@ void BTIF_dm_enable() {
  ** and bonded_devices_info_cb
  */
  btif_storage_load_bonded_devices();
  bluetooth::bqr::EnableBtQualityReport(get_main());
  bluetooth::bqr::EnableBtQualityReport(true);
  btif_enable_bluetooth_evt();
}

@@ -2184,7 +2184,7 @@ void BTIF_dm_disable() {
      btif_in_execute_service_request(i, false);
    }
  }
  bluetooth::bqr::EnableBtQualityReport(nullptr);
  bluetooth::bqr::EnableBtQualityReport(false);
  log::info("Stack device manager shutdown finished");
  future_ready(stack_manager_get_hack_future(), FUTURE_SUCCESS);
}
+1 −367

File changed.

Preview size limit exceeded, changes collapsed.

Loading