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

Commit 82b12383 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10146593 from 064f3a17 to udc-qpr1-release

Change-Id: I7172097c9c89f42bf88bf554eda71db91c78d981
parents e77c6cc1 064f3a17
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -163,6 +163,18 @@ static bool concurrentPeerAuthIsEnabled() {
  return sCONCURRENT_PEER_AUTH_IS_ENABLED;
}

/**
 * Whether we should handle encryption change events from a peer device, while
 * we are in the IDLE state. This matters if we are waiting to retry encryption
 * following an LMP timeout, and then we get an encryption change event from the
 * peer.
 */
static bool handleUnexpectedEncryptionChange() {
  static const bool sHandleUnexpectedEncryptionChange = osi_property_get_bool(
      "bluetooth.btm.sec.handle_unexpected_encryption_change.enabled", false);
  return sHandleUnexpectedEncryptionChange;
}

void NotifyBondingCanceled(tBTM_STATUS btm_status) {
  if (btm_cb.api.p_bond_cancel_cmpl_callback) {
    btm_cb.api.p_bond_cancel_cmpl_callback(BTM_SUCCESS);
@@ -3470,12 +3482,16 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status,
                      __func__, p_dev_rec, p_dev_rec->p_callback);
      p_dev_rec->p_callback = NULL;
      l2cu_resubmit_pending_sec_req(&p_dev_rec->bd_addr);
      return;
    } else if (!concurrentPeerAuthIsEnabled() &&
               p_dev_rec->sec_state == BTM_SEC_STATE_AUTHENTICATING) {
      p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
      return;
    }
    if (!handleUnexpectedEncryptionChange()) {
      return;
    }
  }

  p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
  /* If encryption setup failed, notify the waiting layer */
+11 −6
Original line number Diff line number Diff line
@@ -106,13 +106,18 @@ static std::vector<std::pair<uint16_t, uint16_t>> sdpu_find_profile_version(
        uint16_t uuid = p_ssattr->attr_value.v.u16;
        // Next attribute should be the version attribute
        tSDP_DISC_ATTR* version_attr = p_ssattr->p_next_attr;
        if (SDP_DISC_ATTR_TYPE(version_attr->attr_len_type) != UINT_DESC_TYPE ||
        if (version_attr == nullptr ||
            SDP_DISC_ATTR_TYPE(version_attr->attr_len_type) != UINT_DESC_TYPE ||
            SDP_DISC_ATTR_LEN(version_attr->attr_len_type) != 2) {
          if (version_attr == nullptr) {
            LOG(WARNING) << __func__ << ": version attr not found";
          } else {
            LOG(WARNING) << __func__ << ": Bad version type "
                         << loghex(
                                SDP_DISC_ATTR_TYPE(version_attr->attr_len_type))
                         << ", or length "
                         << SDP_DISC_ATTR_LEN(version_attr->attr_len_type);
          }
          return std::vector<std::pair<uint16_t, uint16_t>>();
        }
        // High order 8 bits is the major number, low order is the