libbinder: modernize unique_fd&& -> unique_fd
The future can't wait!
Bug: N/A
Test: binderRpcTest
Change-Id: I74b041853b528f38e5bc55e8738ec399622cbf1a
diff --git a/libs/binder/RpcConnection.cpp b/libs/binder/RpcConnection.cpp
index ee5f508..fa228b2 100644
--- a/libs/binder/RpcConnection.cpp
+++ b/libs/binder/RpcConnection.cpp
@@ -406,14 +406,14 @@
return true;
}
-void RpcConnection::addClient(unique_fd&& fd) {
+void RpcConnection::addClient(unique_fd fd) {
std::lock_guard<std::mutex> _l(mSocketMutex);
sp<ConnectionSocket> connection = sp<ConnectionSocket>::make();
connection->fd = std::move(fd);
mClients.push_back(connection);
}
-sp<RpcConnection::ConnectionSocket> RpcConnection::assignServerToThisThread(unique_fd&& fd) {
+sp<RpcConnection::ConnectionSocket> RpcConnection::assignServerToThisThread(unique_fd fd) {
std::lock_guard<std::mutex> _l(mSocketMutex);
sp<ConnectionSocket> connection = sp<ConnectionSocket>::make();
connection->fd = std::move(fd);
diff --git a/libs/binder/include/binder/RpcConnection.h b/libs/binder/include/binder/RpcConnection.h
index 3a2d8e5..1b8f4b9 100644
--- a/libs/binder/include/binder/RpcConnection.h
+++ b/libs/binder/include/binder/RpcConnection.h
@@ -148,8 +148,8 @@
bool setupSocketServer(const SocketAddress& address);
bool setupSocketClient(const SocketAddress& address);
bool setupOneSocketClient(const SocketAddress& address);
- void addClient(base::unique_fd&& fd);
- sp<ConnectionSocket> assignServerToThisThread(base::unique_fd&& fd);
+ void addClient(base::unique_fd fd);
+ sp<ConnectionSocket> assignServerToThisThread(base::unique_fd fd);
bool removeServerSocket(const sp<ConnectionSocket>& socket);
enum class SocketUse {