summaryrefslogtreecommitdiff
path: root/libs/binder/Parcel.cpp
diff options
context:
space:
mode:
author Tomasz Wasilczyk <twasilczyk@google.com> 2023-10-09 17:37:16 +0000
committer Tomasz Wasilczyk <twasilczyk@google.com> 2023-10-19 16:33:53 +0000
commit232d0b3721be5009bdbda017496ee9c205e39d23 (patch)
treee7111ebc3d7f2fc52f8798d48fefb19840fdab31 /libs/binder/Parcel.cpp
parent5bd4fecba94f654b1437c9d8970bf65f087c8a74 (diff)
Disable native_handle outside of Android
Bug: 302723053 Test: mma Change-Id: Ia6d80574a3b137c7646b4a8a7575e03197fcb527
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r--libs/binder/Parcel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index a59b9284fc..17bdc455be 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1436,6 +1436,7 @@ status_t Parcel::writeRawNullableParcelable(const Parcelable* parcelable) {
return writeParcelable(*parcelable);
}
+#ifndef BINDER_DISABLE_NATIVE_HANDLE
status_t Parcel::writeNativeHandle(const native_handle* handle)
{
if (!handle || handle->version != sizeof(native_handle))
@@ -1458,6 +1459,7 @@ status_t Parcel::writeNativeHandle(const native_handle* handle)
err = write(handle->data + handle->numFds, sizeof(int)*handle->numInts);
return err;
}
+#endif
status_t Parcel::writeFileDescriptor(int fd, bool takeOwnership) {
if (auto* rpcFields = maybeRpcFields()) {
@@ -2239,6 +2241,7 @@ int32_t Parcel::readExceptionCode() const
return status.exceptionCode();
}
+#ifndef BINDER_DISABLE_NATIVE_HANDLE
native_handle* Parcel::readNativeHandle() const
{
int numFds, numInts;
@@ -2271,6 +2274,7 @@ native_handle* Parcel::readNativeHandle() const
}
return h;
}
+#endif
int Parcel::readFileDescriptor() const {
if (const auto* rpcFields = maybeRpcFields()) {