summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2020-11-16 17:42:46 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2020-11-16 17:42:46 +0000
commit3548159ef1a70d33f639d832ed9a128cdb657dcf (patch)
tree31291596a1fbb7e417d2a2e5026a755a181fe9e3
parent4f08e84390ca07b496e4af2d89c6f9df2fb5feef (diff)
parent2b86119f7fe16c4c1852982c7d3b2a0008733604 (diff)
Merge "libbinder: disable implicit unique_fd get" am: 7795accbd2 am: e8e37c2eb7 am: e21cd3922a am: 2b86119f7f
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1499179 Change-Id: I97fae8a5f43437708902df0a3c433fce164fc79e
-rw-r--r--libs/binder/Android.bp1
-rw-r--r--libs/binder/include/binder/ParcelFileDescriptor.h12
2 files changed, 7 insertions, 6 deletions
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp
index d411191c62..ef4bfb44f7 100644
--- a/libs/binder/Android.bp
+++ b/libs/binder/Android.bp
@@ -147,6 +147,7 @@ cc_library {
"-Wextra",
"-Werror",
"-Wzero-as-null-pointer-constant",
+ "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION",
],
product_variables: {
binder32bit: {
diff --git a/libs/binder/include/binder/ParcelFileDescriptor.h b/libs/binder/include/binder/ParcelFileDescriptor.h
index 4ba6ba8ed2..9896fd7a51 100644
--- a/libs/binder/include/binder/ParcelFileDescriptor.h
+++ b/libs/binder/include/binder/ParcelFileDescriptor.h
@@ -43,22 +43,22 @@ public:
android::status_t readFromParcel(const android::Parcel* parcel) override;
inline bool operator!=(const ParcelFileDescriptor& rhs) const {
- return mFd != rhs.mFd;
+ return mFd.get() != rhs.mFd.get();
}
inline bool operator<(const ParcelFileDescriptor& rhs) const {
- return mFd < rhs.mFd;
+ return mFd.get() < rhs.mFd.get();
}
inline bool operator<=(const ParcelFileDescriptor& rhs) const {
- return mFd <= rhs.mFd;
+ return mFd.get() <= rhs.mFd.get();
}
inline bool operator==(const ParcelFileDescriptor& rhs) const {
- return mFd == rhs.mFd;
+ return mFd.get() == rhs.mFd.get();
}
inline bool operator>(const ParcelFileDescriptor& rhs) const {
- return mFd > rhs.mFd;
+ return mFd.get() > rhs.mFd.get();
}
inline bool operator>=(const ParcelFileDescriptor& rhs) const {
- return mFd >= rhs.mFd;
+ return mFd.get() >= rhs.mFd.get();
}
private:
android::base::unique_fd mFd;