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

Commit 772d56d1 authored by Katherine Lai's avatar Katherine Lai Committed by Gerrit Code Review
Browse files

Merge "floss: Disable enhanced sco connection via sysprop"

parents 6b752714 7279b563
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -96,6 +96,8 @@ void SyspropsModule::parse_config(std::string file_path) {
      "bluetooth.core.le.connection_scan_window_slow",
      "bluetooth.core.le.inquiry_scan_interval",
      "bluetooth.core.le.inquiry_scan_window",
      // SCO
      "bluetooth.sco.disable_enhanced_connection",
  };

  auto config = storage::LegacyConfigFile::FromPath(file_path).Read(kDefaultCapacity);
+17 −3
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include "osi/include/allocator.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "osi/include/properties.h"
#include "stack/btm/btm_sco_hfp_hal.h"
#include "stack/btm/btm_sec.h"
#include "stack/btm/security_device_record.h"
@@ -49,6 +50,13 @@

extern tBTM_CB btm_cb;

/* Default to allow enhanced connections where supported. */
constexpr bool kDefaultDisableEnhancedConnection = false;

/* Sysprops for SCO connection. */
static const char kPropertyDisableEnhancedConnection[] =
    "bluetooth.sco.disable_enhanced_connection";

namespace {
constexpr char kBtmLogTag[] = "SCO";

@@ -149,7 +157,9 @@ static void btm_esco_conn_rsp(uint16_t sco_inx, uint8_t hci_status,
    }
    /* Use Enhanced Synchronous commands if supported */
    if (controller_get_interface()
            ->supports_enhanced_setup_synchronous_connection()) {
            ->supports_enhanced_setup_synchronous_connection() &&
        !osi_property_get_bool(kPropertyDisableEnhancedConnection,
                               kDefaultDisableEnhancedConnection)) {
      BTM_TRACE_DEBUG(
          "%s: txbw 0x%x, rxbw 0x%x, lat 0x%x, retrans 0x%02x, "
          "pkt 0x%04x, path %u",
@@ -481,7 +491,9 @@ static tBTM_STATUS btm_send_connect_request(uint16_t acl_handle,

    /* Use Enhanced Synchronous commands if supported */
    if (controller_get_interface()
            ->supports_enhanced_setup_synchronous_connection()) {
            ->supports_enhanced_setup_synchronous_connection() &&
        !osi_property_get_bool(kPropertyDisableEnhancedConnection,
                               kDefaultDisableEnhancedConnection)) {
      LOG_INFO("Sending enhanced SCO connect request over handle:0x%04x",
               acl_handle);
      LOG(INFO) << __func__ << std::hex << ": enhanced parameter list"
@@ -1347,7 +1359,9 @@ static tBTM_STATUS BTM_ChangeEScoLinkParms(uint16_t sco_inx,

    /* Use Enhanced Synchronous commands if supported */
    if (controller_get_interface()
            ->supports_enhanced_setup_synchronous_connection()) {
            ->supports_enhanced_setup_synchronous_connection() &&
        !osi_property_get_bool(kPropertyDisableEnhancedConnection,
                               kDefaultDisableEnhancedConnection)) {
      btsnd_hcic_enhanced_set_up_synchronous_connection(p_sco->hci_handle,
                                                        p_setup);
      p_setup->packet_types = saved_packet_types;