Skip to content

Commit 4f0c995

Browse files
Treehugger Robotandroid-build-merge-worker-robot
authored andcommitted
Merge "libbinder: fix trusty cpp fd transport modes" into main am: 33da0c2 am: 3ea3bd3
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3547982 Change-Id: Ic37d6529d7060d0bc4982c7b88e5948d8eb34241 Signed-off-by: Automerger Merge Worker <[email protected]>
2 parents 4c54b76 + 3ea3bd3 commit 4f0c995

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

libs/binder/trusty/include/binder/RpcServerTrusty.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ class RpcServerTrusty final : public virtual RefBase {
9797
// By default we use the latest stable version.
9898
LOG_ALWAYS_FATAL_IF(!rpcServer->setProtocolVersion(RPC_WIRE_PROTOCOL_VERSION));
9999

100+
// The default behavior in trusty is to allow handles to be passed with tipc IPC.
101+
// We add mode NONE so that servers do not reject connections from clients who do
102+
// not change their default transport mode.
103+
static const std::vector<RpcSession::FileDescriptorTransportMode>
104+
TRUSTY_SERVER_SUPPORTED_FD_MODES = {RpcSession::FileDescriptorTransportMode::TRUSTY,
105+
RpcSession::FileDescriptorTransportMode::NONE};
106+
107+
rpcServer->setSupportedFileDescriptorTransportModes(TRUSTY_SERVER_SUPPORTED_FD_MODES);
108+
100109
return rpcServer;
101110
}
102111

libs/binder/trusty/rust/binder_rpc_server_bindgen/cpp/ARpcServerTrusty.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ using android::RpcTransportCtxFactoryTipcTrusty;
2727
using android::sp;
2828
using android::wp;
2929

30-
// The default behavior in trusty is to allow handles to be passed with tipc IPC.
31-
// We add mode NONE so that servers do not reject connections from clients who do
32-
// not change their default transport mode.
33-
static const std::vector<RpcSession::FileDescriptorTransportMode> TRUSTY_SERVER_SUPPORTED_FD_MODES =
34-
{RpcSession::FileDescriptorTransportMode::TRUSTY,
35-
RpcSession::FileDescriptorTransportMode::NONE};
36-
3730
struct ARpcServerTrusty {
3831
sp<RpcServer> mRpcServer;
3932

@@ -60,8 +53,6 @@ ARpcServerTrusty* ARpcServerTrusty_newPerSession(AIBinder* (*cb)(const void*, si
6053
return nullptr;
6154
}
6255

63-
rpcServer->setSupportedFileDescriptorTransportModes(TRUSTY_SERVER_SUPPORTED_FD_MODES);
64-
6556
rpcServer->setPerSessionRootObject(
6657
[cb, cbArgSp](wp<RpcSession> /*session*/, const void* addrPtr, size_t len) {
6758
auto* aib = (*cb)(addrPtr, len, cbArgSp.get());

0 commit comments

Comments
 (0)