summaryrefslogtreecommitdiff
path: root/libs/binder/Parcel.cpp
diff options
context:
space:
mode:
author Devin Moore <devinmoore@google.com> 2024-07-01 20:22:23 +0000
committer Devin Moore <devinmoore@google.com> 2024-07-01 20:23:55 +0000
commitf4c9b48c19f1b040efb35932b322f47e7779cafe (patch)
treeec31f5f554aeede92d4c13b2819066e99bb822c2 /libs/binder/Parcel.cpp
parentef291395cd78242306c2a79d9014f6838396ecab (diff)
libbinder: Add log when FDs aren't supported in RpcSession
Give a hint when this error is hit and make it obvious that both sides of the RpcSession need to agree on the FD support for the connection. Test: none Bug: none Change-Id: If7a559721d5886df0b418923e879538179658d85
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r--libs/binder/Parcel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 77b32753de..f30b2aa3f4 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1585,10 +1585,15 @@ status_t Parcel::writeFileDescriptor(int fd, bool takeOwnership) {
fdVariant = borrowed_fd(fd);
}
if (!mAllowFds) {
+ ALOGE("FDs are not allowed in this parcel. Both the service and the client must set "
+ "the FileDescriptorTransportMode and agree on the support.");
return FDS_NOT_ALLOWED;
}
switch (rpcFields->mSession->getFileDescriptorTransportMode()) {
case RpcSession::FileDescriptorTransportMode::NONE: {
+ ALOGE("FDs are not allowed in this RpcSession. Both the service and the client "
+ "must set "
+ "the FileDescriptorTransportMode and agree on the support.");
return FDS_NOT_ALLOWED;
}
case RpcSession::FileDescriptorTransportMode::UNIX: