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

Commit e2e4a268 authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Re-log stack/btm/btm_sec::btm_sec_encrypt_change

Bug: 188074901
Tag: #refactor
Test: gd/cert/run

Change-Id: Iea1b64d0daf176100b4ca47362b67357f901662a
parent 7897c9c0
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -3205,12 +3205,6 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) {
void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status,
                            uint8_t encr_enable) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev_by_handle(handle);
  BTM_TRACE_EVENT(
      "Security Manager: encrypt_change status:%d State:%d, encr_enable = %d",
      status, (p_dev_rec) ? p_dev_rec->sec_state : 0, encr_enable);
  BTM_TRACE_DEBUG("before update p_dev_rec->sec_flags=0x%x",
                  (p_dev_rec) ? p_dev_rec->sec_flags : 0);

  /* For transaction collision we need to wait and repeat.  There is no need */
  /* for random timeout because only peripheral should receive the result */
  if ((status == HCI_ERR_LMP_ERR_TRANS_COLLISION) ||
@@ -3222,6 +3216,14 @@ void btm_sec_encrypt_change(uint16_t handle, tHCI_STATUS status,

  if (!p_dev_rec) return;

  LOG_DEBUG(
      "Security Manager encryption change request hci_status:%s"
      " request:%s state:%s sec_flags:0x%x",
      hci_status_code_text(status).c_str(),
      (encr_enable) ? "encrypt" : "unencrypt",
      (p_dev_rec->sec_state) ? "encrypted" : "unencrypted",
      p_dev_rec->sec_flags);

  if ((status == HCI_SUCCESS) && encr_enable) {
    if (p_dev_rec->hci_handle == handle) {
      p_dev_rec->sec_flags |= (BTM_SEC_AUTHENTICATED | BTM_SEC_ENCRYPTED);