Rewrite dbus code using sdbus-c++

This commit is contained in:
Vibhav Pant
2023-08-15 20:52:51 +05:30
parent 295f9d6b2e
commit f9fb3d259e
30 changed files with 1656 additions and 740 deletions
@@ -1,11 +1,12 @@
#ifndef PLATFORM_IMPL_LINUX_DEVICE_INFO_H_
#define PLATFORM_IMPL_LINUX_DEVICE_INFO_H_
#include <systemd/sd-bus.h>
#include <optional>
#include <string>
#include <sdbus-c++/IConnection.h>
#include <sdbus-c++/IProxy.h>
#include "absl/strings/string_view.h"
#include "internal/platform/implementation/device_info.h"
@@ -14,7 +15,8 @@ namespace linux {
class DeviceInfo : public api::DeviceInfo {
public:
~DeviceInfo() override;
DeviceInfo(sdbus::IConnection &system_bus);
~DeviceInfo() override = default;
std::optional<std::u16string> GetOsDeviceName() const override;
api::DeviceInfo::DeviceType GetDeviceType() const override;
@@ -47,7 +49,9 @@ public:
void
UnregisterScreenLockedListener(absl::string_view listener_name) override{};
sd_bus *system_bus;
private:
std::unique_ptr<sdbus::IProxy> hostname_proxy_;
std::unique_ptr<sdbus::IProxy> login_proxy_;
};
} // namespace linux
} // namespace nearby