From: Chris Manton Date: Tue, 22 Sep 2020 02:09:34 +0000 (-0700) Subject: Streamline conditional stack/btm/btm_ble::btm_ble_connected X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=38ffc618f377e73da9e7a0f7fb9046e7463e3fe3;p=android-x86%2Fsystem-bt.git Streamline conditional stack/btm/btm_ble::btm_ble_connected Towards readable code Bug: 163134718 Tag: #refactor Test: act.py -tc BleCocTest Test: ble paired 2 phones Test: classic paired Bose SoundLink Change-Id: I908ff98f333e173762d25b1e6820db7a433af3af --- diff --git a/stack/btm/btm_ble.cc b/stack/btm/btm_ble.cc index 888077ae2..2f93333b1 100644 --- a/stack/btm/btm_ble.cc +++ b/stack/btm/btm_ble.cc @@ -1747,9 +1747,9 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode, if (!addr_matched) { p_dev_rec->ble.active_addr_type = tBTM_SEC_BLE::BTM_BLE_ADDR_PSEUDO; - } - if (!addr_matched && p_dev_rec->ble.ble_addr_type == BLE_ADDR_RANDOM) { - p_dev_rec->ble.cur_rand_addr = bda; + if (p_dev_rec->ble.ble_addr_type == BLE_ADDR_RANDOM) { + p_dev_rec->ble.cur_rand_addr = bda; + } } btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_ADV_IND_EVT; }