[EGD-7108] Fix disconnecting all devices during unpairing Due to wrong logic, all devices were disconnecing during unparing Now, the disconnecting is performed only when the unpaired devices is the connected one
3 files changed, 9 insertions(+), 1 deletions(-) M module-bluetooth/Bluetooth/CommandHandler.cpp M module-bluetooth/Bluetooth/interface/profiles/ProfileManager.cpp M module-bluetooth/Bluetooth/interface/profiles/ProfileManager.hpp
M module-bluetooth/Bluetooth/CommandHandler.cpp => module-bluetooth/Bluetooth/CommandHandler.cpp +3 -1
@@ 158,7 158,9 @@ namespace bluetooth Error::Code CommandHandler::unpair(uint8_t *addr) { LOG_INFO("Unpairing..."); profileManager->disconnect(); if (profileManager->isAddressActuallyUsed(addr)) { profileManager->disconnect(); } return driver->unpair(addr) ? Error::Success : Error::LibraryError; }
M module-bluetooth/Bluetooth/interface/profiles/ProfileManager.cpp => module-bluetooth/Bluetooth/interface/profiles/ProfileManager.cpp +5 -0
@@ 123,4 123,9 @@ namespace bluetooth profilesList[profileType]->setAudioDevice(device); return switchProfile(profileType); } auto ProfileManager::isAddressActuallyUsed(bd_addr_t address) -> bool { return static_cast<bool>(bd_addr_cmp(address, remoteAddr)); } } // namespace bluetooth
M module-bluetooth/Bluetooth/interface/profiles/ProfileManager.hpp => module-bluetooth/Bluetooth/interface/profiles/ProfileManager.hpp +1 -0