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

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

Use get_btm_client_interface().security.BTM_SecRegister

Towards readable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: Ie54f7af90ba5000fd7a27f153e7e61419dc6fbbb
parent 721605d2
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
#include "stack/gatt/connection_manager.h"
#include "stack/include/acl_api.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/btu.h"
#include "types/raw_address.h"

@@ -310,18 +311,19 @@ void BTA_dm_on_hw_on() {
  btif_dm_get_ble_local_keys(&key_mask, &er, &id_key);

  if (key_mask & BTA_BLE_LOCAL_KEY_TYPE_ER) {
    BTM_BleLoadLocalKeys(BTA_BLE_LOCAL_KEY_TYPE_ER, (tBTM_BLE_LOCAL_KEYS*)&er);
    get_btm_client_interface().ble.BTM_BleLoadLocalKeys(
        BTA_BLE_LOCAL_KEY_TYPE_ER, (tBTM_BLE_LOCAL_KEYS*)&er);
  }
  if (key_mask & BTA_BLE_LOCAL_KEY_TYPE_ID) {
    BTM_BleLoadLocalKeys(BTA_BLE_LOCAL_KEY_TYPE_ID,
                         (tBTM_BLE_LOCAL_KEYS*)&id_key);
    get_btm_client_interface().ble.BTM_BleLoadLocalKeys(
        BTA_BLE_LOCAL_KEY_TYPE_ID, (tBTM_BLE_LOCAL_KEYS*)&id_key);
  }
  bta_dm_search_cb.conn_id = GATT_INVALID_CONN_ID;

  if (bluetooth::shim::is_gd_security_enabled()) {
    bluetooth::shim::BTM_SecRegister(&bta_security);
  } else {
    BTM_SecRegister(&bta_security);
    get_btm_client_interface().security.BTM_SecRegister(&bta_security);
  }

  BTM_SetDefaultLinkSuperTout(p_bta_dm_cfg->link_timeout);