OSDN Git Service

Remove tBT_TRANSPORT from acl_refresh_remote_address
authorChris Manton <cmanton@google.com>
Thu, 27 Aug 2020 17:08:07 +0000 (10:08 -0700)
committerChris Manton <cmanton@google.com>
Sun, 30 Aug 2020 16:42:46 +0000 (09:42 -0700)
By definition this always requires LE transport

Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ia209c486a181700ae687cda99ebd8e3b91443c30

stack/acl/btm_acl.cc
stack/btm/btm_ble_addr.cc
stack/include/acl_api.h

index 8f929f5..160431b 100644 (file)
@@ -2424,10 +2424,11 @@ bool BTM_BLE_IS_RESOLVE_BDA(const RawAddress& x) {
 }
 
 bool acl_refresh_remote_address(const tBTM_SEC_DEV_REC* p_sec_rec,
-                                const RawAddress& bda, tBT_TRANSPORT transport,
-                                uint8_t rra_type, const RawAddress& rpa) {
-  tACL_CONN* p_acl = internal_.btm_bda_to_acl(bda, transport);
+                                const RawAddress& bda, uint8_t rra_type,
+                                const RawAddress& rpa) {
+  tACL_CONN* p_acl = internal_.btm_bda_to_acl(bda, BT_TRANSPORT_LE);
   if (p_acl == nullptr) {
+    LOG_WARN("%s Unable to refresh remote address", __func__);
     return false;
   }
 
index e548bd3..f999629 100644 (file)
@@ -309,7 +309,6 @@ bool btm_random_pseudo_to_identity_addr(RawAddress* random_pseudo,
 void btm_ble_refresh_peer_resolvable_private_addr(const RawAddress& pseudo_bda,
                                                   const RawAddress& rpa,
                                                   uint8_t rra_type) {
-  /* update security record here, in adv event or connection complete process */
   tBTM_SEC_DEV_REC* p_sec_rec = btm_find_dev(pseudo_bda);
   if (p_sec_rec != NULL) {
     p_sec_rec->ble.cur_rand_addr = rpa;
@@ -329,12 +328,12 @@ void btm_ble_refresh_peer_resolvable_private_addr(const RawAddress& pseudo_bda,
                   p_sec_rec->ble.active_addr_type);
 
   /* connection refresh remote address */
-  if (!acl_refresh_remote_address(p_sec_rec, p_sec_rec->bd_addr,
-                                  BT_TRANSPORT_LE, rra_type, rpa)) {
+  if (!acl_refresh_remote_address(p_sec_rec, p_sec_rec->bd_addr, rra_type,
+                                  rpa)) {
     // Try looking up the pseudo random address
     if (!acl_refresh_remote_address(p_sec_rec, p_sec_rec->ble.pseudo_addr,
-                                    BT_TRANSPORT_LE, rra_type, rpa)) {
-      BTM_TRACE_ERROR("%s Unknown device to refresh remote device", __func__);
+                                    rra_type, rpa)) {
+      LOG_ERROR("%s Unknown device to refresh remote device", __func__);
     }
   }
 }
index c349540..c919a88 100644 (file)
@@ -224,8 +224,7 @@ bool acl_ble_is_role_master(const RawAddress& bda);
 bool BTM_BLE_IS_RESOLVE_BDA(const RawAddress& x);
 
 bool acl_refresh_remote_address(const tBTM_SEC_DEV_REC* p_dev_rec,
-                                const RawAddress& remote_bda,
-                                tBT_TRANSPORT transport, uint8_t rra_type,
+                                const RawAddress& remote_bda, uint8_t rra_type,
                                 const RawAddress& rpa);
 
 void btm_establish_continue_from_address(const RawAddress& remote_bda,