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

Commit 3ad935d7 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Fix some sco packet type features

Tag: #gd-refactor
Bug: 141555841
Test: cert/run
Change-Id: I866cfe8763635901406b8563ecc5d4801ebccb87
parent 20a72551
Loading
Loading
Loading
Loading
+10 −14
Original line number Original line Diff line number Diff line
@@ -2432,30 +2432,26 @@ void btm_ble_refresh_local_resolvable_private_addr(
  }
  }
}
}


bool sco_peer_supports_esco_2m_phy(uint16_t hci_handle) {
bool sco_peer_supports_esco_2m_phy(const RawAddress& remote_bda) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(hci_handle);
  uint8_t* features = BTM_ReadRemoteFeatures(remote_bda);
  if (p_acl == nullptr) {
  if (features == nullptr) {
    return false;
  }
  if (!p_acl->peer_lmp_feature_valid[0]) {
    LOG_WARN(
    LOG_WARN(
        "Checking remote features but remote feature read is "
        "Checking remote features but remote feature read is "
        "incomplete");
        "incomplete");
    return false;
  }
  }
  return HCI_EDR_ESCO_2MPS_SUPPORTED(p_acl->peer_lmp_feature_pages[0]);
  return HCI_EDR_ESCO_2MPS_SUPPORTED(features);
}
}


bool sco_peer_supports_esco_3m_phy(uint16_t hci_handle) {
bool sco_peer_supports_esco_3m_phy(const RawAddress& remote_bda) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(hci_handle);
  uint8_t* features = BTM_ReadRemoteFeatures(remote_bda);
  if (p_acl == nullptr) {
  if (features == nullptr) {
    return false;
  }
  if (!p_acl->peer_lmp_feature_valid[0]) {
    LOG_WARN(
    LOG_WARN(
        "Checking remote features but remote feature read is "
        "Checking remote features but remote feature read is "
        "incomplete");
        "incomplete");
    return false;
  }
  }
  return HCI_EDR_ESCO_3MPS_SUPPORTED(p_acl->peer_lmp_feature_pages[0]);
  return HCI_EDR_ESCO_3MPS_SUPPORTED(features);
}
}


bool acl_is_switch_role_idle(const RawAddress& bd_addr,
bool acl_is_switch_role_idle(const RawAddress& bd_addr,
+2 −2
Original line number Original line Diff line number Diff line
@@ -238,12 +238,12 @@ static tBTM_STATUS btm_send_connect_request(uint16_t acl_handle,
    /* UPF25:  Only SCO was brought up in this case */
    /* UPF25:  Only SCO was brought up in this case */
    const RawAddress bd_addr = acl_address_from_handle(acl_handle);
    const RawAddress bd_addr = acl_address_from_handle(acl_handle);
    if (bd_addr != RawAddress::kEmpty) {
    if (bd_addr != RawAddress::kEmpty) {
      if (!sco_peer_supports_esco_2m_phy(acl_handle)) {
      if (!sco_peer_supports_esco_2m_phy(bd_addr)) {
        BTM_TRACE_DEBUG("BTM Remote does not support 2-EDR eSCO");
        BTM_TRACE_DEBUG("BTM Remote does not support 2-EDR eSCO");
        temp_packet_types |=
        temp_packet_types |=
            (ESCO_PKT_TYPES_MASK_NO_2_EV3 | ESCO_PKT_TYPES_MASK_NO_2_EV5);
            (ESCO_PKT_TYPES_MASK_NO_2_EV3 | ESCO_PKT_TYPES_MASK_NO_2_EV5);
      }
      }
      if (!sco_peer_supports_esco_3m_phy(acl_handle)) {
      if (!sco_peer_supports_esco_3m_phy(bd_addr)) {
        BTM_TRACE_DEBUG("BTM Remote does not support 3-EDR eSCO");
        BTM_TRACE_DEBUG("BTM Remote does not support 3-EDR eSCO");
        temp_packet_types |=
        temp_packet_types |=
            (ESCO_PKT_TYPES_MASK_NO_3_EV3 | ESCO_PKT_TYPES_MASK_NO_3_EV5);
            (ESCO_PKT_TYPES_MASK_NO_3_EV3 | ESCO_PKT_TYPES_MASK_NO_3_EV5);
+2 −2
Original line number Original line Diff line number Diff line
@@ -200,8 +200,8 @@ void btm_establish_continue_from_address(const RawAddress& remote_bda,
bool acl_peer_supports_ble_connection_parameters_request(
bool acl_peer_supports_ble_connection_parameters_request(
    const RawAddress& remote_bda);
    const RawAddress& remote_bda);


bool sco_peer_supports_esco_2m_phy(uint16_t hci_handle);
bool sco_peer_supports_esco_2m_phy(const RawAddress& remote_bda);
bool sco_peer_supports_esco_3m_phy(uint16_t hci_handle);
bool sco_peer_supports_esco_3m_phy(const RawAddress& remote_bda);


bool acl_peer_supports_ble_packet_extension(uint16_t hci_handle);
bool acl_peer_supports_ble_packet_extension(uint16_t hci_handle);
bool acl_peer_supports_ble_2m_phy(uint16_t hci_handle);
bool acl_peer_supports_ble_2m_phy(uint16_t hci_handle);