diff options
| author | 2021-05-06 02:49:39 +0000 | |
|---|---|---|
| committer | 2021-05-06 02:49:39 +0000 | |
| commit | 0514efd77fc9d654dd67378f16315c2a67a5c9ca (patch) | |
| tree | 06ad595fe30c810a102b0faaa8c301ce5d119ef1 /libs/binder/RpcServer.cpp | |
| parent | 3cb8d2b893d0cf37194bffebf15eb81b603d0b0a (diff) | |
| parent | 7d3ff4f601d37a302623aa90ffd8b0f141565714 (diff) | |
Merge "libbinder: RPC big 'session' rename" am: f817a62d11 am: 7d3ff4f601
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1697646
Change-Id: Ie507881ee293cd52eaaa3ff5245b76388e0220df
Diffstat (limited to 'libs/binder/RpcServer.cpp')
| -rw-r--r-- | libs/binder/RpcServer.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index de7160ee08..786e2db3b3 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -149,38 +149,38 @@ void RpcServer::join() { { std::lock_guard<std::mutex> _l(mLock); - sp<RpcConnection> connection; - if (id == RPC_CONNECTION_ID_NEW) { + sp<RpcSession> session; + if (id == RPC_SESSION_ID_NEW) { // new client! - LOG_ALWAYS_FATAL_IF(mConnectionIdCounter >= INT32_MAX, "Out of connection IDs"); - mConnectionIdCounter++; + LOG_ALWAYS_FATAL_IF(mSessionIdCounter >= INT32_MAX, "Out of session IDs"); + mSessionIdCounter++; - connection = RpcConnection::make(); - connection->setForServer(wp<RpcServer>::fromExisting(this), mConnectionIdCounter); + session = RpcSession::make(); + session->setForServer(wp<RpcServer>::fromExisting(this), mSessionIdCounter); - mConnections[mConnectionIdCounter] = connection; + mSessions[mSessionIdCounter] = session; } else { - auto it = mConnections.find(id); - if (it == mConnections.end()) { - ALOGE("Cannot add thread, no record of connection with ID %d", id); + auto it = mSessions.find(id); + if (it == mSessions.end()) { + ALOGE("Cannot add thread, no record of session with ID %d", id); continue; } - connection = it->second; + session = it->second; } - connection->startThread(std::move(clientFd)); + session->startThread(std::move(clientFd)); } } } -std::vector<sp<RpcConnection>> RpcServer::listConnections() { +std::vector<sp<RpcSession>> RpcServer::listSessions() { std::lock_guard<std::mutex> _l(mLock); - std::vector<sp<RpcConnection>> connections; - for (auto& [id, connection] : mConnections) { + std::vector<sp<RpcSession>> sessions; + for (auto& [id, session] : mSessions) { (void)id; - connections.push_back(connection); + sessions.push_back(session); } - return connections; + return sessions; } bool RpcServer::setupSocketServer(const RpcSocketAddress& addr) { |