OSDN Git Service

Use get_btm_client_interface().security.BTM_SecRegister
authorChris Manton <cmanton@google.com>
Mon, 4 Jan 2021 06:40:28 +0000 (22:40 -0800)
committerChris Manton <cmanton@google.com>
Thu, 7 Jan 2021 00:56:35 +0000 (16:56 -0800)
Towards readable code

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

Change-Id: Ie54f7af90ba5000fd7a27f153e7e61419dc6fbbb

bta/dm/bta_dm_act.cc

index 9341946..062cfe6 100644 (file)
@@ -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);