summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-17 20:40:23 -0700
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-03-17 20:40:23 -0700
commit4f0c99517cdb67e85bae5e89c2ad387b06076865 (patch)
tree0706462f68cdc8f95a2bed26f89075fb0c88ef71 /libs
parent4c54b762b946f733841c34d79884ccae7747ffde (diff)
parent3ea3bd3ec2615db4b748eec9ff05ea0a11dbdc89 (diff)
Merge "libbinder: fix trusty cpp fd transport modes" into main am: 33da0c2368 am: 3ea3bd3ec2
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3547982 Change-Id: Ic37d6529d7060d0bc4982c7b88e5948d8eb34241 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/trusty/include/binder/RpcServerTrusty.h9
-rw-r--r--libs/binder/trusty/rust/binder_rpc_server_bindgen/cpp/ARpcServerTrusty.cpp9
2 files changed, 9 insertions, 9 deletions
diff --git a/libs/binder/trusty/include/binder/RpcServerTrusty.h b/libs/binder/trusty/include/binder/RpcServerTrusty.h
index 127676bf9a..1ac00ca13f 100644
--- a/libs/binder/trusty/include/binder/RpcServerTrusty.h
+++ b/libs/binder/trusty/include/binder/RpcServerTrusty.h
@@ -97,6 +97,15 @@ private:
// By default we use the latest stable version.
LOG_ALWAYS_FATAL_IF(!rpcServer->setProtocolVersion(RPC_WIRE_PROTOCOL_VERSION));
+ // The default behavior in trusty is to allow handles to be passed with tipc IPC.
+ // We add mode NONE so that servers do not reject connections from clients who do
+ // not change their default transport mode.
+ static const std::vector<RpcSession::FileDescriptorTransportMode>
+ TRUSTY_SERVER_SUPPORTED_FD_MODES = {RpcSession::FileDescriptorTransportMode::TRUSTY,
+ RpcSession::FileDescriptorTransportMode::NONE};
+
+ rpcServer->setSupportedFileDescriptorTransportModes(TRUSTY_SERVER_SUPPORTED_FD_MODES);
+
return rpcServer;
}
diff --git a/libs/binder/trusty/rust/binder_rpc_server_bindgen/cpp/ARpcServerTrusty.cpp b/libs/binder/trusty/rust/binder_rpc_server_bindgen/cpp/ARpcServerTrusty.cpp
index 12e347e4f3..451383a90a 100644
--- a/libs/binder/trusty/rust/binder_rpc_server_bindgen/cpp/ARpcServerTrusty.cpp
+++ b/libs/binder/trusty/rust/binder_rpc_server_bindgen/cpp/ARpcServerTrusty.cpp
@@ -27,13 +27,6 @@ using android::RpcTransportCtxFactoryTipcTrusty;
using android::sp;
using android::wp;
-// The default behavior in trusty is to allow handles to be passed with tipc IPC.
-// We add mode NONE so that servers do not reject connections from clients who do
-// not change their default transport mode.
-static const std::vector<RpcSession::FileDescriptorTransportMode> TRUSTY_SERVER_SUPPORTED_FD_MODES =
- {RpcSession::FileDescriptorTransportMode::TRUSTY,
- RpcSession::FileDescriptorTransportMode::NONE};
-
struct ARpcServerTrusty {
sp<RpcServer> mRpcServer;
@@ -60,8 +53,6 @@ ARpcServerTrusty* ARpcServerTrusty_newPerSession(AIBinder* (*cb)(const void*, si
return nullptr;
}
- rpcServer->setSupportedFileDescriptorTransportModes(TRUSTY_SERVER_SUPPORTED_FD_MODES);
-
rpcServer->setPerSessionRootObject(
[cb, cbArgSp](wp<RpcSession> /*session*/, const void* addrPtr, size_t len) {
auto* aib = (*cb)(addrPtr, len, cbArgSp.get());