libbinder: better session termination naming
- removed unused variable/once used function
- name reflects these are server threads exiting
Bug: 185167543
Test: binderRpcTest
Change-Id: Ib5301132213088ec049bf38fc78372655cdc7d9a
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp
index 156a834..ccf7f89 100644
--- a/libs/binder/RpcSession.cpp
+++ b/libs/binder/RpcSession.cpp
@@ -219,23 +219,7 @@
}
if (server != nullptr) {
- server->onSessionThreadEnding(sp<RpcSession>::fromExisting(this));
- }
-}
-
-void RpcSession::terminateLocked() {
- // TODO(b/185167543):
- // - kindly notify other side of the connection of termination (can't be
- // locked)
- // - prevent new client/servers from being added
- // - stop all threads which are currently reading/writing
- // - terminate RpcState?
-
- if (mTerminated) return;
-
- sp<RpcServer> server = mForServer.promote();
- if (server) {
- server->onSessionTerminating(sp<RpcSession>::fromExisting(this));
+ server->onSessionServerThreadEnded(sp<RpcSession>::fromExisting(this));
}
}
@@ -359,7 +343,10 @@
it != mServerConnections.end()) {
mServerConnections.erase(it);
if (mServerConnections.size() == 0) {
- terminateLocked();
+ sp<RpcServer> server = mForServer.promote();
+ if (server) {
+ server->onSessionLockedAllServerThreadsEnded(sp<RpcSession>::fromExisting(this));
+ }
}
return true;
}