Loading libs/binder/OS.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "OS.h" #include <android-base/file.h> #include <binder/RpcTransportRaw.h> #include <string.h> using android::base::ErrnoError; Loading Loading @@ -58,4 +59,8 @@ status_t dupFileDescriptor(int oldFd, int* newFd) { return OK; } std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory() { return RpcTransportCtxFactoryRaw::make(); } } // namespace android libs/binder/OS.h +3 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <android-base/result.h> #include <android-base/unique_fd.h> #include <binder/RpcTransport.h> #include <utils/Errors.h> namespace android { Loading @@ -30,4 +31,6 @@ status_t getRandomBytes(uint8_t* data, size_t size); status_t dupFileDescriptor(int oldFd, int* newFd); std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory(); } // namespace android libs/binder/RpcServer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ RpcServer::~RpcServer() { sp<RpcServer> RpcServer::make(std::unique_ptr<RpcTransportCtxFactory> rpcTransportCtxFactory) { // Default is without TLS. if (rpcTransportCtxFactory == nullptr) rpcTransportCtxFactory = RpcTransportCtxFactoryRaw::make(); rpcTransportCtxFactory = makeDefaultRpcTransportCtxFactory(); auto ctx = rpcTransportCtxFactory->newServerCtx(); if (ctx == nullptr) return nullptr; return sp<RpcServer>::make(std::move(ctx)); Loading libs/binder/RpcSession.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ RpcSession::~RpcSession() { sp<RpcSession> RpcSession::make() { // Default is without TLS. return make(RpcTransportCtxFactoryRaw::make()); return make(makeDefaultRpcTransportCtxFactory()); } sp<RpcSession> RpcSession::make(std::unique_ptr<RpcTransportCtxFactory> rpcTransportCtxFactory) { Loading libs/binder/trusty/OS.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <lib/rand/rand.h> #endif #include <binder/RpcTransportTipcTrusty.h> #include "../OS.h" using android::base::Result; Loading @@ -46,4 +48,8 @@ status_t dupFileDescriptor(int oldFd, int* newFd) { return INVALID_OPERATION; } std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory() { return RpcTransportCtxFactoryTipcTrusty::make(); } } // namespace android Loading
libs/binder/OS.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "OS.h" #include <android-base/file.h> #include <binder/RpcTransportRaw.h> #include <string.h> using android::base::ErrnoError; Loading Loading @@ -58,4 +59,8 @@ status_t dupFileDescriptor(int oldFd, int* newFd) { return OK; } std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory() { return RpcTransportCtxFactoryRaw::make(); } } // namespace android
libs/binder/OS.h +3 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <android-base/result.h> #include <android-base/unique_fd.h> #include <binder/RpcTransport.h> #include <utils/Errors.h> namespace android { Loading @@ -30,4 +31,6 @@ status_t getRandomBytes(uint8_t* data, size_t size); status_t dupFileDescriptor(int oldFd, int* newFd); std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory(); } // namespace android
libs/binder/RpcServer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ RpcServer::~RpcServer() { sp<RpcServer> RpcServer::make(std::unique_ptr<RpcTransportCtxFactory> rpcTransportCtxFactory) { // Default is without TLS. if (rpcTransportCtxFactory == nullptr) rpcTransportCtxFactory = RpcTransportCtxFactoryRaw::make(); rpcTransportCtxFactory = makeDefaultRpcTransportCtxFactory(); auto ctx = rpcTransportCtxFactory->newServerCtx(); if (ctx == nullptr) return nullptr; return sp<RpcServer>::make(std::move(ctx)); Loading
libs/binder/RpcSession.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ RpcSession::~RpcSession() { sp<RpcSession> RpcSession::make() { // Default is without TLS. return make(RpcTransportCtxFactoryRaw::make()); return make(makeDefaultRpcTransportCtxFactory()); } sp<RpcSession> RpcSession::make(std::unique_ptr<RpcTransportCtxFactory> rpcTransportCtxFactory) { Loading
libs/binder/trusty/OS.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <lib/rand/rand.h> #endif #include <binder/RpcTransportTipcTrusty.h> #include "../OS.h" using android::base::Result; Loading @@ -46,4 +48,8 @@ status_t dupFileDescriptor(int oldFd, int* newFd) { return INVALID_OPERATION; } std::unique_ptr<RpcTransportCtxFactory> makeDefaultRpcTransportCtxFactory() { return RpcTransportCtxFactoryTipcTrusty::make(); } } // namespace android