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

Commit 6b526956 authored by Chris Manton's avatar Chris Manton
Browse files

stack::sec Re-order name callbacks and sec state updates

Bug: 347291753
Test: m .
Flag: EXEMPT, Mechanical Refactor

btm_sec_rmt_name_request_complete

Change-Id: I4f6fce9457b50dfb006b79ce8c2007840e9042db
parent d25e7f7c
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2353,14 +2353,15 @@ void btm_sec_rmt_name_request_complete(const RawAddress* p_bd_addr,
    p_dev_rec->sec_bd_name[0] = 0;
  }

  uint8_t old_sec_state = p_dev_rec->sec_rec.sec_state;
  if (p_dev_rec->sec_rec.sec_state == BTM_SEC_STATE_GETTING_NAME)
    p_dev_rec->sec_rec.sec_state = BTM_SEC_STATE_IDLE;

  /* Notify all clients waiting for name to be resolved */
  call_registered_rmt_name_callbacks(p_bd_addr, p_dev_rec->dev_class,
                                     p_dev_rec->sec_bd_name, status);

  // Security procedure resumes
  uint8_t old_sec_state = p_dev_rec->sec_rec.sec_state;
  if (p_dev_rec->sec_rec.sec_state == BTM_SEC_STATE_GETTING_NAME)
    p_dev_rec->sec_rec.sec_state = BTM_SEC_STATE_IDLE;

  /* If we were delaying asking UI for a PIN because name was not resolved,
   * ask now */
  if ((btm_sec_cb.pairing_state == BTM_PAIR_STATE_WAIT_LOCAL_PIN) &&