From 0d9dec207e5c9b208ff841a4f73a91046c92ed25 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Fri, 6 Oct 2023 20:28:49 +0000 Subject: Binder: Split OS to Android and Unix part, abstract GetThreadId out Bug: 302723053 Test: mma in binder folder Test: aosp/2616196 Change-Id: I73df8fc453df0edf496960853cb0004f1c3a6a43 --- libs/binder/RpcSession.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libs/binder/RpcSession.cpp') diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index c3dee1650e..679b194426 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -70,7 +70,7 @@ RpcSession::~RpcSession() { sp RpcSession::make() { // Default is without TLS. - return make(makeDefaultRpcTransportCtxFactory()); + return make(binder::os::makeDefaultRpcTransportCtxFactory()); } sp RpcSession::make(std::unique_ptr rpcTransportCtxFactory) { @@ -195,7 +195,7 @@ status_t RpcSession::setupPreconnectedClient(base::unique_fd fd, fd = request(); if (!fd.ok()) return BAD_VALUE; } - if (auto res = setNonBlocking(fd); !res.ok()) { + if (auto res = binder::os::setNonBlocking(fd); !res.ok()) { ALOGE("setupPreconnectedClient: %s", res.error().message().c_str()); return res.error().code() == 0 ? UNKNOWN_ERROR : -res.error().code(); } @@ -770,7 +770,7 @@ status_t RpcSession::addOutgoingConnection(std::unique_ptr rpcTran { RpcMutexLockGuard _l(mMutex); connection->rpcTransport = std::move(rpcTransport); - connection->exclusiveTid = rpcGetThreadId(); + connection->exclusiveTid = binder::os::GetThreadId(); mConnections.mOutgoing.push_back(connection); } @@ -825,7 +825,7 @@ sp RpcSession::assignIncomingConnectionToThisThread( sp session = sp::make(); session->rpcTransport = std::move(rpcTransport); - session->exclusiveTid = rpcGetThreadId(); + session->exclusiveTid = binder::os::GetThreadId(); mConnections.mIncoming.push_back(session); mConnections.mMaxIncoming = mConnections.mIncoming.size(); @@ -870,7 +870,7 @@ status_t RpcSession::ExclusiveConnection::find(const sp& session, Co connection->mConnection = nullptr; connection->mReentrant = false; - uint64_t tid = rpcGetThreadId(); + uint64_t tid = binder::os::GetThreadId(); RpcMutexUniqueLock _l(session->mMutex); session->mConnections.mWaitingThreads++; -- cgit v1.2.3-59-g8ed1b