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

Commit c6d4cbd2 authored by Josh Wu's avatar Josh Wu
Browse files

BTM: Switch role after auth complete

Bug: 198755234
Tag: #compatibility
Test: gd/cert/run
Change-Id: I29707abd51a6d8226ad7ddf24c919dcc309a5fd9
parent ad3b9c36
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3140,6 +3140,13 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) {
          // indicate that this is encryption after authentication
          BTM_SetEncryption(p_dev_rec->bd_addr, BT_TRANSPORT_BR_EDR, NULL, NULL,
                            BTM_BLE_SEC_NONE);
        } else if (p_dev_rec->IsLocallyInitiated()) {
          // Encryption will be set in role_changed callback
          BTM_TRACE_DEBUG(
              "%s auth completed in role=peripheral, try to switch role and "
              "encrypt",
              __func__);
          BTM_SwitchRoleToCentral(p_dev_rec->RemoteAddress());
        }
      }
      l2cu_start_post_bond_timer(p_dev_rec->hci_handle);