aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Wiley <wiley@google.com>2016-04-18 17:40:45 +0000
committerChristopher Wiley <wiley@google.com>2016-04-18 17:40:45 +0000
commit6f44f7df98871af1b3ffd9715eb047a21ec2b418 (patch)
tree2eefb67f7e6a9bb9ed04a50a0c3806f90fc6eff0
parent734847ed5fb389ceaec6034d89f81bffe051337d (diff)
downloadperipheralmanager-6f44f7df98871af1b3ffd9715eb047a21ec2b418.tar.gz
Revert "Replace ScopedFd with unique_fd"
This reverts commit 734847ed5fb389ceaec6034d89f81bffe051337d. Change-Id: Idfcb62cc8b7563bccb060dc3ca79a684707b3b6e
-rw-r--r--client/gpio_impl.cc3
-rw-r--r--daemon/gpio_driver.h4
-rw-r--r--daemon/gpio_driver_mock.h2
-rw-r--r--daemon/gpio_driver_sysfs.cc2
-rw-r--r--daemon/gpio_driver_sysfs.h2
-rw-r--r--daemon/gpio_manager.h2
-rw-r--r--daemon/peripheral_manager_client.cc5
-rw-r--r--daemon/peripheral_manager_client.h2
-rw-r--r--ipc/Android.mk2
9 files changed, 10 insertions, 14 deletions
diff --git a/client/gpio_impl.cc b/client/gpio_impl.cc
index dfe5f83..cf57613 100644
--- a/client/gpio_impl.cc
+++ b/client/gpio_impl.cc
@@ -16,7 +16,6 @@
#include "gpio_impl.h"
-#include <android-base/unique_fd.h>
#include <binder/Status.h>
#include "peripheralmanager/constants.h"
@@ -106,7 +105,7 @@ int GpioImpl::GetValue(int* value) {
}
int GpioImpl::GetPollingFd(int* fd) {
- android::base::unique_fd scoped_fd;
+ ScopedFd scoped_fd;
Status ret = client_->GetGpioPollingFd(name_, &scoped_fd);
if (ret.isOk()) {
uint8_t buf[2];
diff --git a/daemon/gpio_driver.h b/daemon/gpio_driver.h
index 20dcbb1..f157ffc 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(::android::base::unique_fd* fd) = 0;
+ virtual bool GetPollingFd(ScopedFd* fd) = 0;
};
// The following is driver boilerplate.
diff --git a/daemon/gpio_driver_mock.h b/daemon/gpio_driver_mock.h
index 4c52f4c..0025325 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(::android::base::unique_fd* fd) { return true; };
+ bool GetPollingFd(ScopedFd* fd) { return true; };
private:
DISALLOW_COPY_AND_ASSIGN(GpioDriverMock);
diff --git a/daemon/gpio_driver_sysfs.cc b/daemon/gpio_driver_sysfs.cc
index f1b75b0..683cb94 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(::android::base::unique_fd* fd) {
+bool GpioDriverSysfs::GetPollingFd(ScopedFd* 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 21e33af..1fbe2d1 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(::android::base::unique_fd* fd) override;
+ bool GetPollingFd(ScopedFd* fd) override;
private:
bool Enable();
diff --git a/daemon/gpio_manager.h b/daemon/gpio_manager.h
index c691f26..a72431a 100644
--- a/daemon/gpio_manager.h
+++ b/daemon/gpio_manager.h
@@ -74,7 +74,7 @@ class GpioPin {
return pin_->driver_->SetEdgeType(type);
}
- bool GetPollingFd(::android::base::unique_fd* fd) {
+ bool GetPollingFd(ScopedFd* fd) {
return pin_->driver_->GetPollingFd(fd);
}
diff --git a/daemon/peripheral_manager_client.cc b/daemon/peripheral_manager_client.cc
index 82cc068..d279a9f 100644
--- a/daemon/peripheral_manager_client.cc
+++ b/daemon/peripheral_manager_client.cc
@@ -101,9 +101,8 @@ Status PeripheralManagerClient::GetGpioValue(const std::string& name,
return Status::fromServiceSpecificError(EREMOTEIO);
}
-Status PeripheralManagerClient::GetGpioPollingFd(
- const std::string& name,
- ::android::base::unique_fd* fd) {
+Status PeripheralManagerClient::GetGpioPollingFd(const std::string& name,
+ ScopedFd* fd) {
if (!gpios_.count(name))
return Status::fromServiceSpecificError(EPERM);
diff --git a/daemon/peripheral_manager_client.h b/daemon/peripheral_manager_client.h
index 4c24398..23d15c7 100644
--- a/daemon/peripheral_manager_client.h
+++ b/daemon/peripheral_manager_client.h
@@ -60,7 +60,7 @@ class PeripheralManagerClient : public BnPeripheralManagerClient {
virtual Status GetGpioValue(const std::string& name, bool* value) override;
virtual Status GetGpioPollingFd(const std::string& name,
- ::android::base::unique_fd* fd) override;
+ ScopedFd* fd) override;
virtual Status ListSpiBuses(std::vector<std::string>* buses) override;
diff --git a/ipc/Android.mk b/ipc/Android.mk
index ce77290..949482a 100644
--- a/ipc/Android.mk
+++ b/ipc/Android.mk
@@ -23,8 +23,6 @@ LOCAL_SRC_FILES := \
android/os/IPeripheralManagerClient.aidl \
android/os/IPeripheralManager.aidl \
-LOCAL_SHARED_LIBRARIES := libbinder
-
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)
include $(BUILD_STATIC_LIBRARY)