OSDN Git Service

Revert "libbinder: Replace ScopedFd with base::unique_fd"
authorChristopher Wiley <wiley@google.com>
Mon, 18 Apr 2016 17:40:56 +0000 (17:40 +0000)
committerChristopher Wiley <wiley@google.com>
Mon, 18 Apr 2016 17:40:56 +0000 (17:40 +0000)
This reverts commit b12c5a67f9cf5a55f67c08bef898c48cefa9d03d.

Change-Id: I13ab8151376bc3bda7f96b92db7934720dc62215

include/binder/Parcel.h
libs/binder/Android.mk
libs/binder/Parcel.cpp

index 91a8ab8..9c3877e 100644 (file)
@@ -21,7 +21,7 @@
 #include <vector>
 
 #include <cutils/native_handle.h>
-#include <android-base/unique_fd.h>
+#include <nativehelper/ScopedFd.h>
 #include <utils/Errors.h>
 #include <utils/RefBase.h>
 #include <utils/String16.h>
@@ -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<std::vector<base::unique_fd>>& val);
+                            const std::unique_ptr<std::vector<ScopedFd>>& val);
     status_t            writeUniqueFileDescriptorVector(
-                            const std::vector<base::unique_fd>& val);
+                            const std::vector<ScopedFd>& 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<std::vector<base::unique_fd>>* val) const;
+                            std::unique_ptr<std::vector<ScopedFd>>* val) const;
     status_t            readUniqueFileDescriptorVector(
-                            std::vector<base::unique_fd>* val) const;
+                            std::vector<ScopedFd>* val) const;
 
     // Reads a blob from the parcel.
     // The caller should call release() on the blob after reading its contents.
index 2483659..adb9674 100644 (file)
@@ -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)
index 6fd6ddc..1ecc5ce 100644 (file)
@@ -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<base::unique_fd>& val) {
+status_t Parcel::writeUniqueFileDescriptorVector(const std::vector<ScopedFd>& val) {
     return writeTypedVector(val, &Parcel::writeUniqueFileDescriptor);
 }
 
-status_t Parcel::writeUniqueFileDescriptorVector(const std::unique_ptr<std::vector<base::unique_fd>>& val) {
+status_t Parcel::writeUniqueFileDescriptorVector(const std::unique_ptr<std::vector<ScopedFd>>& 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<std::vector<base::unique_fd>>* val) const {
+status_t Parcel::readUniqueFileDescriptorVector(std::unique_ptr<std::vector<ScopedFd>>* val) const {
     return readNullableTypedVector(val, &Parcel::readUniqueFileDescriptor);
 }
 
-status_t Parcel::readUniqueFileDescriptorVector(std::vector<base::unique_fd>* val) const {
+status_t Parcel::readUniqueFileDescriptorVector(std::vector<ScopedFd>* val) const {
     return readTypedVector(val, &Parcel::readUniqueFileDescriptor);
 }