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

Commit 660827bd authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Jakub Pawłowski
Browse files

Enable EATT when encryption is enabled on link

Previously we were enabling EATT when authentication was complete.
Authentication can complete i.e. when CTKD finishes on Classic link,
while LE link is not encrypted.

Test: manual
Bug: 270489002
Change-Id: I89ee4e65c9f386c71c130729459d7e2b2e3ac6a0
parent cec4c33f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include "stack/btm/btm_int_types.h"
#include "stack/btm/security_device_record.h"
#include "stack/crypto_toolbox/crypto_toolbox.h"
#include "stack/eatt/eatt.h"
#include "stack/include/acl_api.h"
#include "stack/include/bt_octets.h"
#include "stack/include/bt_types.h"
@@ -1515,6 +1516,13 @@ void btm_ble_link_encrypted(const RawAddress& bd_addr, uint8_t encr_enable) {
    else if (p_dev_rec->role_central)
      btm_sec_dev_rec_cback_event(p_dev_rec, BTM_ERR_PROCESSING, true);
  }

  if (encr_enable) {
    /* Link is encrypted, start EATT */
    bluetooth::eatt::EattExtension::GetInstance()->Connect(
        p_dev_rec->ble.pseudo_addr);
  }

  /* to notify GATT to send data if any request is pending */
  gatt_notify_enc_cmpl(p_dev_rec->ble.pseudo_addr);
}
+0 −7
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@
#include "osi/include/properties.h"
#include "stack/btm/btm_dev.h"
#include "stack/btm/security_device_record.h"
#include "stack/eatt/eatt.h"
#include "stack/include/acl_api.h"
#include "stack/include/acl_hci_link_interface.h"
#include "stack/include/btm_status.h"
@@ -4796,12 +4795,6 @@ void btm_sec_dev_rec_cback_event(tBTM_SEC_DEV_REC* p_dev_rec,
  }

  btm_sec_check_pending_reqs();

  if (btm_status == BTM_SUCCESS && is_le_transport) {
    /* Link is encrypted, start EATT */
    bluetooth::eatt::EattExtension::GetInstance()->Connect(
        p_dev_rec->ble.pseudo_addr);
  }
}

void btm_sec_cr_loc_oob_data_cback_event(const RawAddress& address,