Separate BluetoothAdapter into Adapter and BluezAdapter classes.

This commit is contained in:
Vibhav Pant
2023-08-29 15:47:13 +05:30
parent 6abeac91ce
commit adb1e1d235
6 changed files with 78 additions and 76 deletions
@@ -100,15 +100,15 @@ bool BluetoothPairing::CancelPairing() {
}
bool BluetoothPairing::Unpair() {
try {
adapter_.RemoveDevice(device_.getObjectPath());
try {
adapter_.RemoveDeviceByObjectPath(device_.getObjectPath());
return true;
} catch (const sdbus::Error &e) {
NEARBY_LOGS(ERROR) << __func__ << ": Got error '" << e.getName()
<< "' with message '" << e.getMessage()
<< "' while trying to unpair device "
<< device_.getObjectPath() << " on adapter "
<< adapter_.getObjectPath();
<< adapter_.GetObjectPath();
return false;
}
}