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

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

Use some L2cap APIs in btm_sec am: 9308fa44 am: 2209c2ed am: d3cfb787

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1a852efb478e8fb947b83e879e78639f4a6c9ed4
parents 8955f487 d3cfb787
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -2603,14 +2603,6 @@ uint8_t acl_link_role_from_handle(uint16_t handle) {
  return p_acl->link_role;
}

bool acl_is_transport_le_from_handle(uint16_t handle) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(handle);
  if (p_acl == nullptr) {
    return false;
  }
  return p_acl->transport == BT_TRANSPORT_LE;
}

tBT_TRANSPORT acl_get_transport_from_handle(uint16_t handle) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(handle);
  if (p_acl == nullptr) {
+4 −7
Original line number Diff line number Diff line
@@ -1096,7 +1096,7 @@ tBTM_STATUS BTM_SetEncryption(const RawAddress& bd_addr,
  if (transport == BT_TRANSPORT_LE) {
    if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE)) {
      rc = btm_ble_set_encryption(bd_addr, sec_act,
                                  acl_link_role(bd_addr, transport));
                                  L2CA_GetBleConnRole(bd_addr));
    } else {
      rc = BTM_WRONG_MODE;
      BTM_TRACE_WARNING("%s: cannot call btm_ble_set_encryption, p is NULL",
@@ -3204,13 +3204,10 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status,
  BTM_TRACE_DEBUG("after update p_dev_rec->sec_flags=0x%x",
                  p_dev_rec->sec_flags);

  if (BTM_IsAclConnectionUpFromHandle(handle)) {
  btm_sec_check_pending_enc_req(
      p_dev_rec, acl_get_transport_from_handle(handle), encr_enable);
  }

  if (BTM_IsAclConnectionUpFromHandle(handle) &&
      acl_is_transport_le_from_handle(handle)) {
  if (BTM_IsBleConnection(handle)) {
    if (status == HCI_ERR_KEY_MISSING || status == HCI_ERR_AUTH_FAILURE ||
        status == HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE) {
      p_dev_rec->sec_flags &= ~(BTM_SEC_LE_LINK_KEY_KNOWN);
+0 −2
Original line number Diff line number Diff line
@@ -283,8 +283,6 @@ void btm_cont_rswitch_from_handle(uint16_t hci_handle);
uint8_t acl_link_role(const RawAddress& remote_bda, tBT_TRANSPORT transport);
uint8_t acl_link_role_from_handle(uint16_t handle);

bool acl_is_transport_le_from_handle(uint16_t handle);

tBT_TRANSPORT acl_get_transport_from_handle(uint16_t handle);

uint16_t acl_get_hci_handle_for_hcif(const RawAddress& bd_addr,