Loading system/main/shim/btm_api.h +0 −25 Original line number Diff line number Diff line Loading @@ -1120,31 +1120,6 @@ uint16_t BTM_BleReadDiscoverability(); ******************************************************************************/ uint16_t BTM_BleReadConnectability(); /******************************************************************************* * * Function BTM_BleConfigPrivacy * * Description This function is called to enable or disable the privacy in * the local device. * * Parameters enable: true to enable it; false to disable it. * * Returns bool privacy mode set success; otherwise failed. * ******************************************************************************/ bool BTM_BleConfigPrivacy(bool enable); /******************************************************************************* * * Function BTM_BleLocalPrivacyEnabled * * Description Checks if local device supports private address * * Returns Return true if local privacy is enabled else false * ******************************************************************************/ bool BTM_BleLocalPrivacyEnabled(void); /** * This functions are called to configure the adv data payload filter condition */ Loading system/stack/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -238,7 +238,6 @@ cc_library_static { "arbiter/acl_arbiter.cc", "btm/ble_advertiser_hci_interface.cc", "btm/ble_scanner_hci_interface.cc", "btm/btm_ble.cc", "btm/btm_ble_addr.cc", "btm/btm_ble_adv_filter.cc", "btm/btm_ble_batchscan.cc", Loading @@ -247,6 +246,7 @@ cc_library_static { "btm/btm_ble_gap.cc", "btm/btm_ble_privacy.cc", "btm/btm_ble_scanner.cc", "btm/btm_ble_sec.cc", "btm/btm_client_interface.cc", "btm/btm_dev.cc", "btm/btm_devctl.cc", Loading Loading @@ -1511,7 +1511,6 @@ cc_test { "acl/btm_pm.cc", "btm/ble_advertiser_hci_interface.cc", "btm/ble_scanner_hci_interface.cc", "btm/btm_ble.cc", "btm/btm_ble_addr.cc", "btm/btm_ble_adv_filter.cc", "btm/btm_ble_batchscan.cc", Loading @@ -1520,6 +1519,7 @@ cc_test { "btm/btm_ble_gap.cc", "btm/btm_ble_privacy.cc", "btm/btm_ble_scanner.cc", "btm/btm_ble_sec.cc", "btm/btm_client_interface.cc", "btm/btm_dev.cc", "btm/btm_devctl.cc", Loading system/stack/BUILD.gn +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ source_set("stack") { "bnep/bnep_utils.cc", "btm/ble_advertiser_hci_interface.cc", "btm/ble_scanner_hci_interface.cc", "btm/btm_ble.cc", "btm/btm_ble_addr.cc", "btm/btm_ble_adv_filter.cc", "btm/btm_ble_batchscan.cc", Loading @@ -114,6 +113,7 @@ source_set("stack") { "btm/btm_ble_gap.cc", "btm/btm_ble_privacy.cc", "btm/btm_ble_scanner.cc", "btm/btm_ble_sec.cc", "btm/btm_client_interface.cc", "btm/btm_dev.cc", "btm/btm_devctl.cc", Loading system/stack/btm/btm_ble.cc→system/stack/btm/btm_ble_sec.cc +11 −16 Original line number Diff line number Diff line Loading @@ -65,10 +65,6 @@ bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec, void gatt_notify_phy_updated(tHCI_STATUS status, uint16_t handle, uint8_t tx_phy, uint8_t rx_phy); #ifndef PROPERTY_BLE_PRIVACY_ENABLED #define PROPERTY_BLE_PRIVACY_ENABLED "bluetooth.core.gap.le.privacy.enabled" #endif namespace { constexpr char kBtmLogTag[] = "SEC"; } Loading Loading @@ -98,7 +94,8 @@ void BTM_SecAddBleDevice(const RawAddress& bd_addr, tBT_DEVICE_TYPE dev_type, p_dev_rec->conn_params.peripheral_latency = BTM_BLE_CONN_PARAM_UNDEF; LOG_DEBUG("Device added, handle=0x%x, p_dev_rec=%p, bd_addr=%s", p_dev_rec->ble_hci_handle, p_dev_rec, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); p_dev_rec->ble_hci_handle, p_dev_rec, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); } memset(p_dev_rec->sec_bd_name, 0, sizeof(tBTM_BD_NAME)); Loading Loading @@ -177,8 +174,8 @@ void BTM_SecAddBleKey(const RawAddress& bd_addr, tBTM_LE_KEY_VALUE* p_le_key, return; } LOG_DEBUG("Adding BLE key device:%s key_type:%hhu", ADDRESS_TO_LOGGABLE_CSTR(bd_addr), key_type); LOG_DEBUG("Adding BLE key device:%s key_type:%hhu", ADDRESS_TO_LOGGABLE_CSTR(bd_addr), key_type); btm_sec_save_le_key(bd_addr, key_type, p_le_key, false); // Only set peer irk. Local irk is always the same. Loading Loading @@ -1489,16 +1486,14 @@ void btm_ble_link_encrypted(const RawAddress& bd_addr, uint8_t encr_enable) { p_dev_rec->sec_state = BTM_SEC_STATE_IDLE; if (p_dev_rec->p_callback && enc_cback) { if (encr_enable) btm_sec_dev_rec_cback_event(p_dev_rec, BTM_SUCCESS, true); if (encr_enable) btm_sec_dev_rec_cback_event(p_dev_rec, BTM_SUCCESS, true); /* LTK missing on peripheral */ else if (p_dev_rec->role_central && (p_dev_rec->sec_status == HCI_ERR_KEY_MISSING)) { else if (p_dev_rec->role_central && (p_dev_rec->sec_status == HCI_ERR_KEY_MISSING)) { btm_sec_dev_rec_cback_event(p_dev_rec, BTM_ERR_KEY_MISSING, true); } else if (!(p_dev_rec->sec_flags & BTM_SEC_LE_LINK_KEY_KNOWN)) { } else if (!(p_dev_rec->sec_flags & BTM_SEC_LE_LINK_KEY_KNOWN)) { btm_sec_dev_rec_cback_event(p_dev_rec, BTM_FAILED_ON_SECURITY, true); } else if (p_dev_rec->role_central) } else if (p_dev_rec->role_central) btm_sec_dev_rec_cback_event(p_dev_rec, BTM_ERR_PROCESSING, true); } Loading system/stack/include/btm_ble_api.h +26 −0 Original line number Diff line number Diff line Loading @@ -580,4 +580,30 @@ void BTM_BlePeriodicSyncSetInfo(RawAddress addr, uint16_t service_data, void BTM_BlePeriodicSyncTxParameters(RawAddress addr, uint8_t mode, uint16_t skip, uint16_t timeout, StartSyncCb syncCb); /******************************************************************************* * * Function BTM_BleConfigPrivacy * * Description This function is called to enable or disable the privacy in * the local device. * * Parameters enable: true to enable it; false to disable it. * * Returns bool privacy mode set success; otherwise failed. * ******************************************************************************/ bool BTM_BleConfigPrivacy(bool enable); /******************************************************************************* * * Function BTM_BleLocalPrivacyEnabled * * Description Checks if local device supports private address * * Returns Return true if local privacy is enabled else false * ******************************************************************************/ bool BTM_BleLocalPrivacyEnabled(void); #endif Loading
system/main/shim/btm_api.h +0 −25 Original line number Diff line number Diff line Loading @@ -1120,31 +1120,6 @@ uint16_t BTM_BleReadDiscoverability(); ******************************************************************************/ uint16_t BTM_BleReadConnectability(); /******************************************************************************* * * Function BTM_BleConfigPrivacy * * Description This function is called to enable or disable the privacy in * the local device. * * Parameters enable: true to enable it; false to disable it. * * Returns bool privacy mode set success; otherwise failed. * ******************************************************************************/ bool BTM_BleConfigPrivacy(bool enable); /******************************************************************************* * * Function BTM_BleLocalPrivacyEnabled * * Description Checks if local device supports private address * * Returns Return true if local privacy is enabled else false * ******************************************************************************/ bool BTM_BleLocalPrivacyEnabled(void); /** * This functions are called to configure the adv data payload filter condition */ Loading
system/stack/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -238,7 +238,6 @@ cc_library_static { "arbiter/acl_arbiter.cc", "btm/ble_advertiser_hci_interface.cc", "btm/ble_scanner_hci_interface.cc", "btm/btm_ble.cc", "btm/btm_ble_addr.cc", "btm/btm_ble_adv_filter.cc", "btm/btm_ble_batchscan.cc", Loading @@ -247,6 +246,7 @@ cc_library_static { "btm/btm_ble_gap.cc", "btm/btm_ble_privacy.cc", "btm/btm_ble_scanner.cc", "btm/btm_ble_sec.cc", "btm/btm_client_interface.cc", "btm/btm_dev.cc", "btm/btm_devctl.cc", Loading Loading @@ -1511,7 +1511,6 @@ cc_test { "acl/btm_pm.cc", "btm/ble_advertiser_hci_interface.cc", "btm/ble_scanner_hci_interface.cc", "btm/btm_ble.cc", "btm/btm_ble_addr.cc", "btm/btm_ble_adv_filter.cc", "btm/btm_ble_batchscan.cc", Loading @@ -1520,6 +1519,7 @@ cc_test { "btm/btm_ble_gap.cc", "btm/btm_ble_privacy.cc", "btm/btm_ble_scanner.cc", "btm/btm_ble_sec.cc", "btm/btm_client_interface.cc", "btm/btm_dev.cc", "btm/btm_devctl.cc", Loading
system/stack/BUILD.gn +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ source_set("stack") { "bnep/bnep_utils.cc", "btm/ble_advertiser_hci_interface.cc", "btm/ble_scanner_hci_interface.cc", "btm/btm_ble.cc", "btm/btm_ble_addr.cc", "btm/btm_ble_adv_filter.cc", "btm/btm_ble_batchscan.cc", Loading @@ -114,6 +113,7 @@ source_set("stack") { "btm/btm_ble_gap.cc", "btm/btm_ble_privacy.cc", "btm/btm_ble_scanner.cc", "btm/btm_ble_sec.cc", "btm/btm_client_interface.cc", "btm/btm_dev.cc", "btm/btm_devctl.cc", Loading
system/stack/btm/btm_ble.cc→system/stack/btm/btm_ble_sec.cc +11 −16 Original line number Diff line number Diff line Loading @@ -65,10 +65,6 @@ bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec, void gatt_notify_phy_updated(tHCI_STATUS status, uint16_t handle, uint8_t tx_phy, uint8_t rx_phy); #ifndef PROPERTY_BLE_PRIVACY_ENABLED #define PROPERTY_BLE_PRIVACY_ENABLED "bluetooth.core.gap.le.privacy.enabled" #endif namespace { constexpr char kBtmLogTag[] = "SEC"; } Loading Loading @@ -98,7 +94,8 @@ void BTM_SecAddBleDevice(const RawAddress& bd_addr, tBT_DEVICE_TYPE dev_type, p_dev_rec->conn_params.peripheral_latency = BTM_BLE_CONN_PARAM_UNDEF; LOG_DEBUG("Device added, handle=0x%x, p_dev_rec=%p, bd_addr=%s", p_dev_rec->ble_hci_handle, p_dev_rec, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); p_dev_rec->ble_hci_handle, p_dev_rec, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); } memset(p_dev_rec->sec_bd_name, 0, sizeof(tBTM_BD_NAME)); Loading Loading @@ -177,8 +174,8 @@ void BTM_SecAddBleKey(const RawAddress& bd_addr, tBTM_LE_KEY_VALUE* p_le_key, return; } LOG_DEBUG("Adding BLE key device:%s key_type:%hhu", ADDRESS_TO_LOGGABLE_CSTR(bd_addr), key_type); LOG_DEBUG("Adding BLE key device:%s key_type:%hhu", ADDRESS_TO_LOGGABLE_CSTR(bd_addr), key_type); btm_sec_save_le_key(bd_addr, key_type, p_le_key, false); // Only set peer irk. Local irk is always the same. Loading Loading @@ -1489,16 +1486,14 @@ void btm_ble_link_encrypted(const RawAddress& bd_addr, uint8_t encr_enable) { p_dev_rec->sec_state = BTM_SEC_STATE_IDLE; if (p_dev_rec->p_callback && enc_cback) { if (encr_enable) btm_sec_dev_rec_cback_event(p_dev_rec, BTM_SUCCESS, true); if (encr_enable) btm_sec_dev_rec_cback_event(p_dev_rec, BTM_SUCCESS, true); /* LTK missing on peripheral */ else if (p_dev_rec->role_central && (p_dev_rec->sec_status == HCI_ERR_KEY_MISSING)) { else if (p_dev_rec->role_central && (p_dev_rec->sec_status == HCI_ERR_KEY_MISSING)) { btm_sec_dev_rec_cback_event(p_dev_rec, BTM_ERR_KEY_MISSING, true); } else if (!(p_dev_rec->sec_flags & BTM_SEC_LE_LINK_KEY_KNOWN)) { } else if (!(p_dev_rec->sec_flags & BTM_SEC_LE_LINK_KEY_KNOWN)) { btm_sec_dev_rec_cback_event(p_dev_rec, BTM_FAILED_ON_SECURITY, true); } else if (p_dev_rec->role_central) } else if (p_dev_rec->role_central) btm_sec_dev_rec_cback_event(p_dev_rec, BTM_ERR_PROCESSING, true); } Loading
system/stack/include/btm_ble_api.h +26 −0 Original line number Diff line number Diff line Loading @@ -580,4 +580,30 @@ void BTM_BlePeriodicSyncSetInfo(RawAddress addr, uint16_t service_data, void BTM_BlePeriodicSyncTxParameters(RawAddress addr, uint8_t mode, uint16_t skip, uint16_t timeout, StartSyncCb syncCb); /******************************************************************************* * * Function BTM_BleConfigPrivacy * * Description This function is called to enable or disable the privacy in * the local device. * * Parameters enable: true to enable it; false to disable it. * * Returns bool privacy mode set success; otherwise failed. * ******************************************************************************/ bool BTM_BleConfigPrivacy(bool enable); /******************************************************************************* * * Function BTM_BleLocalPrivacyEnabled * * Description Checks if local device supports private address * * Returns Return true if local privacy is enabled else false * ******************************************************************************/ bool BTM_BleLocalPrivacyEnabled(void); #endif