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

Commit e135e4c2 authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

Fix some sco packet type features am: 3ad935d7

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1564873

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia12471fbeea392b6e8b37888e1988a113526e744
parents 592ed3ea 3ad935d7
Loading
Loading
Loading
Loading
+10 −14
Original line number 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) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(hci_handle);
  if (p_acl == nullptr) {
    return false;
  }
  if (!p_acl->peer_lmp_feature_valid[0]) {
bool sco_peer_supports_esco_2m_phy(const RawAddress& remote_bda) {
  uint8_t* features = BTM_ReadRemoteFeatures(remote_bda);
  if (features == nullptr) {
    LOG_WARN(
        "Checking remote features but remote feature read is "
        "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) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(hci_handle);
  if (p_acl == nullptr) {
    return false;
  }
  if (!p_acl->peer_lmp_feature_valid[0]) {
bool sco_peer_supports_esco_3m_phy(const RawAddress& remote_bda) {
  uint8_t* features = BTM_ReadRemoteFeatures(remote_bda);
  if (features == nullptr) {
    LOG_WARN(
        "Checking remote features but remote feature read is "
        "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,
+2 −2
Original line number 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 */
    const RawAddress bd_addr = acl_address_from_handle(acl_handle);
    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");
        temp_packet_types |=
            (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");
        temp_packet_types |=
            (ESCO_PKT_TYPES_MASK_NO_3_EV3 | ESCO_PKT_TYPES_MASK_NO_3_EV5);
+2 −2
Original line number 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(
    const RawAddress& remote_bda);

bool sco_peer_supports_esco_2m_phy(uint16_t hci_handle);
bool sco_peer_supports_esco_3m_phy(uint16_t hci_handle);
bool sco_peer_supports_esco_2m_phy(const RawAddress& remote_bda);
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_2m_phy(uint16_t hci_handle);