Fix more compilation errors.

This commit is contained in:
Vibhav Pant
2023-08-27 20:48:09 +05:30
parent 5910a511b6
commit a46c033a13
10 changed files with 50 additions and 97 deletions
@@ -3,10 +3,10 @@
#include <sdbus-c++/Types.h>
#include "absl/synchronization/mutex.h"
#include "internal/platform/implementation/linux/bluetooth_classic_device.h"
#include "internal/platform/implementation/linux/bluetooth_devices.h"
#include "internal/platform/implementation/linux/bluez.h"
#include "absl/synchronization/mutex.h"
namespace nearby {
namespace linux {
@@ -19,8 +19,8 @@ BluetoothDevices::get_device_by_path(
return std::nullopt;
}
auto &device = devices_by_path_[device_object_path];
return device;
auto &device = devices_by_path_.at(device_object_path);
return *device;
}
std::optional<std::reference_wrapper<BluetoothDevice>>
@@ -40,10 +40,11 @@ void BluetoothDevices::remove_device_by_path(
BluetoothDevice &
BluetoothDevices::add_new_device(sdbus::ObjectPath device_object_path) {
absl::MutexLock l(&devices_by_path_lock_);
auto pair =
devices_by_path_.emplace(device_object_path, system_bus_,
std::move(device_object_path), observers_);
return pair.first->second;
auto pair = devices_by_path_.emplace(
std::string(device_object_path),
std::make_unique<MonitoredBluetoothDevice>(
system_bus_, std::move(device_object_path), observers_));
return *pair.first->second;
}
} // namespace linux
} // namespace nearby