summaryrefslogtreecommitdiff
path: root/libs/binder/RpcServer.cpp
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-11-21 07:53:05 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-11-21 07:53:05 +0000
commitd66061b7f960e24facd77f52c633a3b97fd89418 (patch)
tree88b5162530d32056d7cd37e59245fb0da179ec21 /libs/binder/RpcServer.cpp
parentb029cb573e4bef5688757f3dfa129a848dfa372c (diff)
parentb59b0e832374b13f4a7ae9ec0758a20363b1c1c1 (diff)
Merge "Binder unique_fd" into main am: 1cc6ef1a50 am: b59b0e8323
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2813342 Change-Id: I9df19ec5dad8d1f58a52ca0082c0c80f9c864250 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/binder/RpcServer.cpp')
-rw-r--r--libs/binder/RpcServer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp
index fefaa810d2..d9e926a9d5 100644
--- a/libs/binder/RpcServer.cpp
+++ b/libs/binder/RpcServer.cpp
@@ -45,7 +45,8 @@ namespace android {
constexpr size_t kSessionIdBytes = 32;
using namespace android::binder::impl;
-using base::unique_fd;
+using android::binder::borrowed_fd;
+using android::binder::unique_fd;
RpcServer::RpcServer(std::unique_ptr<RpcTransportCtx> ctx) : mCtx(std::move(ctx)) {}
RpcServer::~RpcServer() {
@@ -166,7 +167,7 @@ void RpcServer::setConnectionFilter(std::function<bool(const void*, size_t)>&& f
mConnectionFilter = std::move(filter);
}
-void RpcServer::setServerSocketModifier(std::function<void(base::borrowed_fd)>&& modifier) {
+void RpcServer::setServerSocketModifier(std::function<void(borrowed_fd)>&& modifier) {
RpcMutexLockGuard _l(mLock);
LOG_ALWAYS_FATAL_IF(mServer.fd.ok(), "Already started");
mServerSocketModifier = std::move(modifier);
@@ -213,7 +214,7 @@ status_t RpcServer::acceptSocketConnection(const RpcServer& server, RpcTransport
status_t RpcServer::recvmsgSocketConnection(const RpcServer& server, RpcTransportFd* out) {
int zero = 0;
iovec iov{&zero, sizeof(zero)};
- std::vector<std::variant<base::unique_fd, base::borrowed_fd>> fds;
+ std::vector<std::variant<unique_fd, borrowed_fd>> fds;
ssize_t num_bytes = binder::os::receiveMessageFromSocket(server.mServer, &iov, 1, &fds);
if (num_bytes < 0) {
@@ -644,8 +645,7 @@ unique_fd RpcServer::releaseServer() {
}
status_t RpcServer::setupExternalServer(
- base::unique_fd serverFd,
- std::function<status_t(const RpcServer&, RpcTransportFd*)>&& acceptFn) {
+ unique_fd serverFd, std::function<status_t(const RpcServer&, RpcTransportFd*)>&& acceptFn) {
RpcMutexLockGuard _l(mLock);
if (mServer.fd.ok()) {
ALOGE("Each RpcServer can only have one server.");
@@ -656,7 +656,7 @@ status_t RpcServer::setupExternalServer(
return OK;
}
-status_t RpcServer::setupExternalServer(base::unique_fd serverFd) {
+status_t RpcServer::setupExternalServer(unique_fd serverFd) {
return setupExternalServer(std::move(serverFd), &RpcServer::acceptSocketConnection);
}