Loading libs/binder/Binder.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -547,7 +547,6 @@ status_t BBinder::setRpcClientDebug(android::base::unique_fd socketFd, AutoMutex _l(e->mLock); auto rpcServer = RpcServer::make(); LOG_ALWAYS_FATAL_IF(rpcServer == nullptr, "RpcServer::make returns null"); rpcServer->iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction(); auto link = sp<RpcServerLink>::make(rpcServer, keepAliveBinder, weakThis); if (auto status = keepAliveBinder->linkToDeath(link, nullptr, 0); status != OK) { ALOGE("%s: keepAliveBinder->linkToDeath returns %s", __PRETTY_FUNCTION__, Loading libs/binder/RpcServer.cpp +0 −12 Original line number Diff line number Diff line Loading @@ -58,10 +58,6 @@ sp<RpcServer> RpcServer::make(std::unique_ptr<RpcTransportCtxFactory> rpcTranspo return sp<RpcServer>::make(std::move(ctx)); } void RpcServer::iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction() { mAgreedExperimental = true; } status_t RpcServer::setupUnixDomainServer(const char* path) { return setupSocketServer(UnixSocketAddress(path)); } Loading Loading @@ -163,14 +159,12 @@ static void joinRpcServer(sp<RpcServer>&& thiz) { } void RpcServer::start() { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); std::lock_guard<std::mutex> _l(mLock); LOG_ALWAYS_FATAL_IF(mJoinThread.get(), "Already started!"); mJoinThread = std::make_unique<std::thread>(&joinRpcServer, sp<RpcServer>::fromExisting(this)); } void RpcServer::join() { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); { std::lock_guard<std::mutex> _l(mLock); Loading Loading @@ -274,9 +268,6 @@ size_t RpcServer::numUninitializedSessions() { void RpcServer::establishConnection(sp<RpcServer>&& server, base::unique_fd clientFd, const sockaddr_storage addr, socklen_t addrLen) { // TODO(b/183988761): cannot trust this simple ID LOG_ALWAYS_FATAL_IF(!server->mAgreedExperimental, "no!"); // mShutdownTrigger can only be cleared once connection threads have joined. // It must be set before this thread is started LOG_ALWAYS_FATAL_IF(server->mShutdownTrigger == nullptr); Loading Loading @@ -506,19 +497,16 @@ void RpcServer::onSessionIncomingThreadEnded() { } bool RpcServer::hasServer() { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); std::lock_guard<std::mutex> _l(mLock); return mServer.ok(); } unique_fd RpcServer::releaseServer() { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); std::lock_guard<std::mutex> _l(mLock); return std::move(mServer); } status_t RpcServer::setupExternalServer(base::unique_fd serverFd) { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); std::lock_guard<std::mutex> _l(mLock); if (mServer.ok()) { ALOGE("Each RpcServer can only have one server."); Loading libs/binder/include/binder/RpcServer.h +0 −7 Original line number Diff line number Diff line Loading @@ -25,10 +25,6 @@ #include <mutex> #include <thread> // WARNING: This is a feature which is still in development, and it is subject // to radical change. Any production use of this may subject your code to any // number of problems. namespace android { class FdTrigger; Loading Loading @@ -99,8 +95,6 @@ public: */ [[nodiscard]] status_t setupExternalServer(base::unique_fd serverFd); void iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction(); /** * This must be called before adding a client session. * Loading Loading @@ -188,7 +182,6 @@ private: status_t setupSocketServer(const RpcSocketAddress& address); const std::unique_ptr<RpcTransportCtx> mCtx; bool mAgreedExperimental = false; size_t mMaxThreads = 1; std::optional<uint32_t> mProtocolVersion; base::unique_fd mServer; // socket we are accepting sessions on Loading libs/binder/include/binder/RpcSession.h +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ #include <thread> #include <vector> // WARNING: This is a feature which is still in development, and it is subject // to radical change. Any production use of this may subject your code to any // number of problems. namespace android { class Parcel; Loading libs/binder/libbinder_rpc_unstable.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ extern "C" { bool RunRpcServerCallback(AIBinder* service, unsigned int port, void (*readyCallback)(void* param), void* param) { auto server = RpcServer::make(); server->iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction(); if (status_t status = server->setupVsockServer(port); status != OK) { LOG(ERROR) << "Failed to set up vsock server with port " << port << " error: " << statusToString(status).c_str(); Loading Loading
libs/binder/Binder.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -547,7 +547,6 @@ status_t BBinder::setRpcClientDebug(android::base::unique_fd socketFd, AutoMutex _l(e->mLock); auto rpcServer = RpcServer::make(); LOG_ALWAYS_FATAL_IF(rpcServer == nullptr, "RpcServer::make returns null"); rpcServer->iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction(); auto link = sp<RpcServerLink>::make(rpcServer, keepAliveBinder, weakThis); if (auto status = keepAliveBinder->linkToDeath(link, nullptr, 0); status != OK) { ALOGE("%s: keepAliveBinder->linkToDeath returns %s", __PRETTY_FUNCTION__, Loading
libs/binder/RpcServer.cpp +0 −12 Original line number Diff line number Diff line Loading @@ -58,10 +58,6 @@ sp<RpcServer> RpcServer::make(std::unique_ptr<RpcTransportCtxFactory> rpcTranspo return sp<RpcServer>::make(std::move(ctx)); } void RpcServer::iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction() { mAgreedExperimental = true; } status_t RpcServer::setupUnixDomainServer(const char* path) { return setupSocketServer(UnixSocketAddress(path)); } Loading Loading @@ -163,14 +159,12 @@ static void joinRpcServer(sp<RpcServer>&& thiz) { } void RpcServer::start() { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); std::lock_guard<std::mutex> _l(mLock); LOG_ALWAYS_FATAL_IF(mJoinThread.get(), "Already started!"); mJoinThread = std::make_unique<std::thread>(&joinRpcServer, sp<RpcServer>::fromExisting(this)); } void RpcServer::join() { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); { std::lock_guard<std::mutex> _l(mLock); Loading Loading @@ -274,9 +268,6 @@ size_t RpcServer::numUninitializedSessions() { void RpcServer::establishConnection(sp<RpcServer>&& server, base::unique_fd clientFd, const sockaddr_storage addr, socklen_t addrLen) { // TODO(b/183988761): cannot trust this simple ID LOG_ALWAYS_FATAL_IF(!server->mAgreedExperimental, "no!"); // mShutdownTrigger can only be cleared once connection threads have joined. // It must be set before this thread is started LOG_ALWAYS_FATAL_IF(server->mShutdownTrigger == nullptr); Loading Loading @@ -506,19 +497,16 @@ void RpcServer::onSessionIncomingThreadEnded() { } bool RpcServer::hasServer() { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); std::lock_guard<std::mutex> _l(mLock); return mServer.ok(); } unique_fd RpcServer::releaseServer() { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); std::lock_guard<std::mutex> _l(mLock); return std::move(mServer); } status_t RpcServer::setupExternalServer(base::unique_fd serverFd) { LOG_ALWAYS_FATAL_IF(!mAgreedExperimental, "no!"); std::lock_guard<std::mutex> _l(mLock); if (mServer.ok()) { ALOGE("Each RpcServer can only have one server."); Loading
libs/binder/include/binder/RpcServer.h +0 −7 Original line number Diff line number Diff line Loading @@ -25,10 +25,6 @@ #include <mutex> #include <thread> // WARNING: This is a feature which is still in development, and it is subject // to radical change. Any production use of this may subject your code to any // number of problems. namespace android { class FdTrigger; Loading Loading @@ -99,8 +95,6 @@ public: */ [[nodiscard]] status_t setupExternalServer(base::unique_fd serverFd); void iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction(); /** * This must be called before adding a client session. * Loading Loading @@ -188,7 +182,6 @@ private: status_t setupSocketServer(const RpcSocketAddress& address); const std::unique_ptr<RpcTransportCtx> mCtx; bool mAgreedExperimental = false; size_t mMaxThreads = 1; std::optional<uint32_t> mProtocolVersion; base::unique_fd mServer; // socket we are accepting sessions on Loading
libs/binder/include/binder/RpcSession.h +0 −4 Original line number Diff line number Diff line Loading @@ -26,10 +26,6 @@ #include <thread> #include <vector> // WARNING: This is a feature which is still in development, and it is subject // to radical change. Any production use of this may subject your code to any // number of problems. namespace android { class Parcel; Loading
libs/binder/libbinder_rpc_unstable.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ extern "C" { bool RunRpcServerCallback(AIBinder* service, unsigned int port, void (*readyCallback)(void* param), void* param) { auto server = RpcServer::make(); server->iUnderstandThisCodeIsExperimentalAndIWillNotUseItInProduction(); if (status_t status = server->setupVsockServer(port); status != OK) { LOG(ERROR) << "Failed to set up vsock server with port " << port << " error: " << statusToString(status).c_str(); Loading