From 46ef1a7f578d20423961e6b989dad0524bcad13a Mon Sep 17 00:00:00 2001 From: Christopher Wiley Date: Mon, 18 Apr 2016 17:40:56 +0000 Subject: [PATCH] Revert "libbinder: Replace ScopedFd with base::unique_fd" This reverts commit b12c5a67f9cf5a55f67c08bef898c48cefa9d03d. Change-Id: I13ab8151376bc3bda7f96b92db7934720dc62215 --- include/binder/Parcel.h | 14 +++++++------- libs/binder/Android.mk | 6 ++---- libs/binder/Parcel.cpp | 12 ++++++------ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h index 91a8ab8af1..9c3877ec4a 100644 --- a/include/binder/Parcel.h +++ b/include/binder/Parcel.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -186,14 +186,14 @@ public: // semantics of the smart file descriptor. A new descriptor will be // created, and will be closed when the parcel is destroyed. status_t writeUniqueFileDescriptor( - const base::unique_fd& fd); + const ScopedFd& fd); // Place a vector of file desciptors into the parcel. Each descriptor is // dup'd as in writeDupFileDescriptor status_t writeUniqueFileDescriptorVector( - const std::unique_ptr>& val); + const std::unique_ptr>& val); status_t writeUniqueFileDescriptorVector( - const std::vector& val); + const std::vector& val); // Writes a blob to the parcel. // If the blob is small, then it is stored in-place, otherwise it is @@ -324,14 +324,14 @@ public: // Retrieve a smart file descriptor from the parcel. status_t readUniqueFileDescriptor( - base::unique_fd* val) const; + ScopedFd* val) const; // Retrieve a vector of smart file descriptors from the parcel. status_t readUniqueFileDescriptorVector( - std::unique_ptr>* val) const; + std::unique_ptr>* val) const; status_t readUniqueFileDescriptorVector( - std::vector* val) const; + std::vector* val) const; // Reads a blob from the parcel. // The caller should call release() on the blob after reading its contents. diff --git a/libs/binder/Android.mk b/libs/binder/Android.mk index 2483659de1..adb9674d79 100644 --- a/libs/binder/Android.mk +++ b/libs/binder/Android.mk @@ -44,8 +44,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libbinder -LOCAL_SHARED_LIBRARIES := libbase liblog libcutils libutils -LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := libbase libutils +LOCAL_SHARED_LIBRARIES := liblog libcutils libutils LOCAL_CLANG := true LOCAL_SANITIZE := integer @@ -60,8 +59,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := libbinder -LOCAL_STATIC_LIBRARIES := libbase libutils -LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libbase libutils +LOCAL_STATIC_LIBRARIES += libutils LOCAL_SRC_FILES := $(sources) ifneq ($(TARGET_USES_64_BIT_BINDER),true) ifneq ($(TARGET_IS_64_BIT),true) diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 6fd6ddc073..1ecc5cef35 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1184,15 +1184,15 @@ status_t Parcel::writeDupFileDescriptor(int fd) return err; } -status_t Parcel::writeUniqueFileDescriptor(const base::unique_fd& fd) { +status_t Parcel::writeUniqueFileDescriptor(const ScopedFd& fd) { return writeDupFileDescriptor(fd.get()); } -status_t Parcel::writeUniqueFileDescriptorVector(const std::vector& val) { +status_t Parcel::writeUniqueFileDescriptorVector(const std::vector& val) { return writeTypedVector(val, &Parcel::writeUniqueFileDescriptor); } -status_t Parcel::writeUniqueFileDescriptorVector(const std::unique_ptr>& val) { +status_t Parcel::writeUniqueFileDescriptorVector(const std::unique_ptr>& val) { return writeNullableTypedVector(val, &Parcel::writeUniqueFileDescriptor); } @@ -1992,7 +1992,7 @@ int Parcel::readFileDescriptor() const return BAD_TYPE; } -status_t Parcel::readUniqueFileDescriptor(base::unique_fd* val) const +status_t Parcel::readUniqueFileDescriptor(ScopedFd* val) const { int got = readFileDescriptor(); @@ -2010,11 +2010,11 @@ status_t Parcel::readUniqueFileDescriptor(base::unique_fd* val) const } -status_t Parcel::readUniqueFileDescriptorVector(std::unique_ptr>* val) const { +status_t Parcel::readUniqueFileDescriptorVector(std::unique_ptr>* val) const { return readNullableTypedVector(val, &Parcel::readUniqueFileDescriptor); } -status_t Parcel::readUniqueFileDescriptorVector(std::vector* val) const { +status_t Parcel::readUniqueFileDescriptorVector(std::vector* val) const { return readTypedVector(val, &Parcel::readUniqueFileDescriptor); } -- 2.11.0