libbinder: Replace ScopedFd with base::unique_fd
unique_fd is a more canonical construct going forward.
Bug: 27804373
Test: checkbuilds pass on aosp x86_64-eng
Change-Id: I8c1f202f1a6d646b5468f8c08fdcab7ea7f3178b
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h
index 9c3877e..91a8ab8 100644
--- a/include/binder/Parcel.h
+++ b/include/binder/Parcel.h
@@ -21,7 +21,7 @@
#include <vector>
#include <cutils/native_handle.h>
-#include <nativehelper/ScopedFd.h>
+#include <android-base/unique_fd.h>
#include <utils/Errors.h>
#include <utils/RefBase.h>
#include <utils/String16.h>
@@ -186,14 +186,14 @@
// 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 ScopedFd& fd);
+ const base::unique_fd& 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<ScopedFd>>& val);
+ const std::unique_ptr<std::vector<base::unique_fd>>& val);
status_t writeUniqueFileDescriptorVector(
- const std::vector<ScopedFd>& val);
+ const std::vector<base::unique_fd>& 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 @@
// Retrieve a smart file descriptor from the parcel.
status_t readUniqueFileDescriptor(
- ScopedFd* val) const;
+ base::unique_fd* val) const;
// Retrieve a vector of smart file descriptors from the parcel.
status_t readUniqueFileDescriptorVector(
- std::unique_ptr<std::vector<ScopedFd>>* val) const;
+ std::unique_ptr<std::vector<base::unique_fd>>* val) const;
status_t readUniqueFileDescriptorVector(
- std::vector<ScopedFd>* val) const;
+ std::vector<base::unique_fd>* val) const;
// Reads a blob from the parcel.
// The caller should call release() on the blob after reading its contents.