Loading system/stack/btm/btm_dev.cc +36 −31 Original line number Diff line number Diff line Loading @@ -159,15 +159,24 @@ void BTM_AcceptlistRemove(const RawAddress& address); * Returns true if removed OK, false if not found or ACL link is active. */ bool BTM_SecDeleteDevice(const RawAddress& bd_addr) { tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec == NULL) { LOG_WARN("Unable to delete link key for unknown device %s", ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); return true; } /* Invalidate bonded status */ p_dev_rec->sec_flags &= ~BTM_SEC_LINK_KEY_KNOWN; p_dev_rec->sec_flags &= ~BTM_SEC_LE_LINK_KEY_KNOWN; if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE) || BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_BR_EDR)) { LOG_WARN("%s FAILED: Cannot Delete when connection to %s is active", __func__, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); LOG_WARN("FAILED: Cannot Delete when connection to %s is active", ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); return false; } tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec != NULL) { RawAddress bda = p_dev_rec->bd_addr; LOG_INFO("Remove device %s from filter accept list before delete record", Loading @@ -189,15 +198,11 @@ bool BTM_SecDeleteDevice(const RawAddress& bd_addr) { wipe_secrets_and_remove(p_dev_rec); /* Tell controller to get rid of the link key, if it has one stored */ BTM_DeleteStoredLinkKey(&bda, NULL); LOG_INFO("%s %s complete", __func__, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); LOG_INFO("%s complete", ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); BTM_LogHistory(kBtmLogTag, bd_addr, "Device removed", base::StringPrintf("device_type:%s bond_type:%s", DeviceTypeText(device_type).c_str(), bond_type_text(bond_type).c_str())); } else { LOG_WARN("%s Unable to delete link key for unknown device %s", __func__, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); } return true; } Loading Loading
system/stack/btm/btm_dev.cc +36 −31 Original line number Diff line number Diff line Loading @@ -159,15 +159,24 @@ void BTM_AcceptlistRemove(const RawAddress& address); * Returns true if removed OK, false if not found or ACL link is active. */ bool BTM_SecDeleteDevice(const RawAddress& bd_addr) { tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec == NULL) { LOG_WARN("Unable to delete link key for unknown device %s", ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); return true; } /* Invalidate bonded status */ p_dev_rec->sec_flags &= ~BTM_SEC_LINK_KEY_KNOWN; p_dev_rec->sec_flags &= ~BTM_SEC_LE_LINK_KEY_KNOWN; if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE) || BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_BR_EDR)) { LOG_WARN("%s FAILED: Cannot Delete when connection to %s is active", __func__, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); LOG_WARN("FAILED: Cannot Delete when connection to %s is active", ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); return false; } tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec != NULL) { RawAddress bda = p_dev_rec->bd_addr; LOG_INFO("Remove device %s from filter accept list before delete record", Loading @@ -189,15 +198,11 @@ bool BTM_SecDeleteDevice(const RawAddress& bd_addr) { wipe_secrets_and_remove(p_dev_rec); /* Tell controller to get rid of the link key, if it has one stored */ BTM_DeleteStoredLinkKey(&bda, NULL); LOG_INFO("%s %s complete", __func__, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); LOG_INFO("%s complete", ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); BTM_LogHistory(kBtmLogTag, bd_addr, "Device removed", base::StringPrintf("device_type:%s bond_type:%s", DeviceTypeText(device_type).c_str(), bond_type_text(bond_type).c_str())); } else { LOG_WARN("%s Unable to delete link key for unknown device %s", __func__, ADDRESS_TO_LOGGABLE_CSTR(bd_addr)); } return true; } Loading