OSDN Git Service

Re-log btif_update_remote_version_property
authorChris Manton <cmanton@google.com>
Fri, 12 Mar 2021 01:57:21 +0000 (17:57 -0800)
committerChris Manton <cmanton@google.com>
Wed, 21 Apr 2021 21:27:26 +0000 (21:27 +0000)
Toward readable code

Bug: 163134718
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I1fab5db45be15edaae5a6a68f5661347fe80cf02

btif/src/btif_dm.cc

index 9b67e34..c967032 100644 (file)
@@ -480,14 +480,16 @@ static void btif_update_remote_version_property(RawAddress* p_bd) {
   uint8_t lmp_ver = 0;
   uint16_t lmp_subver = 0;
   uint16_t mfct_set = 0;
-  bool version_info_valid = false;
   bt_remote_version_t info;
   bt_status_t status;
 
-  version_info_valid =
+  CHECK(p_bd != nullptr);
+
+  const bool version_info_valid =
       BTM_ReadRemoteVersion(*p_bd, &lmp_ver, &mfct_set, &lmp_subver);
 
-  LOG_INFO("remote version info [%s]: %x, %x, %x", p_bd->ToString().c_str(),
+  LOG_INFO("Remote version info valid:%s [%s]: %x, %x, %x",
+           logbool(version_info_valid).c_str(), PRIVATE_ADDRESS((*p_bd)),
            lmp_ver, mfct_set, lmp_subver);
 
   if (version_info_valid) {