diff options
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gpio_driver.h | 4 | ||||
-rw-r--r-- | daemon/gpio_driver_mock.h | 2 | ||||
-rw-r--r-- | daemon/gpio_driver_sysfs.cc | 2 | ||||
-rw-r--r-- | daemon/gpio_driver_sysfs.h | 2 | ||||
-rw-r--r-- | daemon/gpio_manager.h | 2 | ||||
-rw-r--r-- | daemon/peripheral_manager_client.cc | 5 | ||||
-rw-r--r-- | daemon/peripheral_manager_client.h | 2 |
7 files changed, 10 insertions, 9 deletions
diff --git a/daemon/gpio_driver.h b/daemon/gpio_driver.h index f157ffc..20dcbb1 100644 --- a/daemon/gpio_driver.h +++ b/daemon/gpio_driver.h @@ -22,8 +22,8 @@ #include <memory> #include <string> +#include <android-base/unique_fd.h> #include <base/macros.h> -#include <nativehelper/ScopedFd.h> #include <peripheralmanager/constants.h> namespace android { @@ -43,7 +43,7 @@ class GpioDriverInterface { virtual bool SetActiveType(GpioActiveType type) = 0; virtual bool SetDirection(GpioDirection direction) = 0; virtual bool SetEdgeType(GpioEdgeType type) = 0; - virtual bool GetPollingFd(ScopedFd* fd) = 0; + virtual bool GetPollingFd(::android::base::unique_fd* fd) = 0; }; // The following is driver boilerplate. diff --git a/daemon/gpio_driver_mock.h b/daemon/gpio_driver_mock.h index 0025325..4c52f4c 100644 --- a/daemon/gpio_driver_mock.h +++ b/daemon/gpio_driver_mock.h @@ -40,7 +40,7 @@ class GpioDriverMock : public GpioDriverInterface { bool SetActiveType(GpioActiveType type) { return true; }; bool SetDirection(GpioDirection direction) { return true; }; bool SetEdgeType(GpioEdgeType type) { return true; }; - bool GetPollingFd(ScopedFd* fd) { return true; }; + bool GetPollingFd(::android::base::unique_fd* fd) { return true; }; private: DISALLOW_COPY_AND_ASSIGN(GpioDriverMock); diff --git a/daemon/gpio_driver_sysfs.cc b/daemon/gpio_driver_sysfs.cc index 683cb94..f1b75b0 100644 --- a/daemon/gpio_driver_sysfs.cc +++ b/daemon/gpio_driver_sysfs.cc @@ -145,7 +145,7 @@ bool GpioDriverSysfs::SetEdgeType(GpioEdgeType type) { return false; } -bool GpioDriverSysfs::GetPollingFd(ScopedFd* fd) { +bool GpioDriverSysfs::GetPollingFd(::android::base::unique_fd* fd) { int f = openat(fd_, kValue, O_RDWR); if (f < 0) return false; diff --git a/daemon/gpio_driver_sysfs.h b/daemon/gpio_driver_sysfs.h index 1fbe2d1..21e33af 100644 --- a/daemon/gpio_driver_sysfs.h +++ b/daemon/gpio_driver_sysfs.h @@ -40,7 +40,7 @@ class GpioDriverSysfs : public GpioDriverInterface { bool SetActiveType(GpioActiveType type) override; bool SetDirection(GpioDirection direction) override; bool SetEdgeType(GpioEdgeType type) override; - bool GetPollingFd(ScopedFd* fd) override; + bool GetPollingFd(::android::base::unique_fd* fd) override; private: bool Enable(); diff --git a/daemon/gpio_manager.h b/daemon/gpio_manager.h index a72431a..c691f26 100644 --- a/daemon/gpio_manager.h +++ b/daemon/gpio_manager.h @@ -74,7 +74,7 @@ class GpioPin { return pin_->driver_->SetEdgeType(type); } - bool GetPollingFd(ScopedFd* fd) { + bool GetPollingFd(::android::base::unique_fd* fd) { return pin_->driver_->GetPollingFd(fd); } diff --git a/daemon/peripheral_manager_client.cc b/daemon/peripheral_manager_client.cc index b862dba..bd05537 100644 --- a/daemon/peripheral_manager_client.cc +++ b/daemon/peripheral_manager_client.cc @@ -101,8 +101,9 @@ Status PeripheralManagerClient::GetGpioValue(const std::string& name, return Status::fromServiceSpecificError(EREMOTEIO); } -Status PeripheralManagerClient::GetGpioPollingFd(const std::string& name, - ScopedFd* fd) { +Status PeripheralManagerClient::GetGpioPollingFd( + const std::string& name, + ::android::base::unique_fd* fd) { if (!gpios_.count(name)) return Status::fromServiceSpecificError(EPERM); diff --git a/daemon/peripheral_manager_client.h b/daemon/peripheral_manager_client.h index bbf2954..4db211d 100644 --- a/daemon/peripheral_manager_client.h +++ b/daemon/peripheral_manager_client.h @@ -59,7 +59,7 @@ class PeripheralManagerClient : public BnPeripheralManagerClient { virtual Status GetGpioValue(const std::string& name, bool* value) override; virtual Status GetGpioPollingFd(const std::string& name, - ScopedFd* fd) override; + ::android::base::unique_fd* fd) override; // Spi functions. virtual Status ListSpiBuses(std::vector<std::string>* buses) override; |