libbinder: RPC disambiguate server/client
Now:
- server: RpcServer
- client: a client of an RpcServer
- incoming: a thread processing commands (either as part of an
RpcServer's sessions or back to a client which has a threadpool)
- outgoing: a thread for sending commands (either to an RpcServer's
sessions or back to a client which has a threadpool)
Bug: 167966510
Test: binderRpcTest
Change-Id: Iea286ab0ff6f9fb775994247003b8d29c999e10a
diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp
index 050f4fb..8dd6daf 100644
--- a/libs/binder/RpcState.cpp
+++ b/libs/binder/RpcState.cpp
@@ -272,7 +272,7 @@
status_t RpcState::sendConnectionInit(const sp<RpcSession::RpcConnection>& connection,
const sp<RpcSession>& session) {
- RpcClientConnectionInit init{
+ RpcOutgoingConnectionInit init{
.msg = RPC_CONNECTION_INIT_OKAY,
};
return rpcSend(connection, session, "connection init", &init, sizeof(init));
@@ -280,7 +280,7 @@
status_t RpcState::readConnectionInit(const sp<RpcSession::RpcConnection>& connection,
const sp<RpcSession>& session) {
- RpcClientConnectionInit init;
+ RpcOutgoingConnectionInit init;
if (status_t status = rpcRec(connection, session, "connection init", &init, sizeof(init));
status != OK)
return status;
@@ -470,7 +470,7 @@
if (command.command == RPC_COMMAND_REPLY) break;
- if (status_t status = processServerCommand(connection, session, command, CommandType::ANY);
+ if (status_t status = processCommand(connection, session, command, CommandType::ANY);
status != OK)
return status;
}
@@ -539,7 +539,7 @@
status != OK)
return status;
- return processServerCommand(connection, session, command, type);
+ return processCommand(connection, session, command, type);
}
status_t RpcState::drainCommands(const sp<RpcSession::RpcConnection>& connection,
@@ -553,9 +553,9 @@
return OK;
}
-status_t RpcState::processServerCommand(const sp<RpcSession::RpcConnection>& connection,
- const sp<RpcSession>& session, const RpcWireHeader& command,
- CommandType type) {
+status_t RpcState::processCommand(const sp<RpcSession::RpcConnection>& connection,
+ const sp<RpcSession>& session, const RpcWireHeader& command,
+ CommandType type) {
IPCThreadState* kernelBinderState = IPCThreadState::selfOrNull();
IPCThreadState::SpGuard spGuard{
.address = __builtin_frame_address(0),