Loading include/binder/unique_fd.h 0 → 120000 +1 −0 Original line number Diff line number Diff line ../../libs/binder/include/binder/unique_fd.h No newline at end of file libs/binder/Binder.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ #include <atomic> #include <set> #include <android-base/unique_fd.h> #include <binder/BpBinder.h> #include <binder/IInterface.h> #include <binder/IPCThreadState.h> Loading @@ -28,6 +27,7 @@ #include <binder/Parcel.h> #include <binder/RecordedTransaction.h> #include <binder/RpcServer.h> #include <binder/unique_fd.h> #include <pthread.h> #include <inttypes.h> Loading @@ -43,6 +43,8 @@ namespace android { using android::binder::unique_fd; constexpr uid_t kUidRoot = 0; // Service implementations inherit from BBinder and IBinder, and this is frozen Loading Loading @@ -167,8 +169,7 @@ status_t IBinder::getDebugPid(pid_t* out) { return OK; } status_t IBinder::setRpcClientDebug(android::base::unique_fd socketFd, const sp<IBinder>& keepAliveBinder) { status_t IBinder::setRpcClientDebug(unique_fd socketFd, const sp<IBinder>& keepAliveBinder) { if (!kEnableRpcDevServers) { ALOGW("setRpcClientDebug disallowed because RPC is not enabled"); return INVALID_OPERATION; Loading Loading @@ -273,7 +274,7 @@ public: std::set<sp<RpcServerLink>> mRpcServerLinks; BpBinder::ObjectManager mObjects; android::base::unique_fd mRecordingFd; unique_fd mRecordingFd; }; // --------------------------------------------------------------------------- Loading Loading @@ -640,7 +641,7 @@ status_t BBinder::setRpcClientDebug(const Parcel& data) { } status_t status; bool hasSocketFd; android::base::unique_fd clientFd; unique_fd clientFd; if (status = data.readBool(&hasSocketFd); status != OK) return status; if (hasSocketFd) { Loading @@ -652,8 +653,7 @@ status_t BBinder::setRpcClientDebug(const Parcel& data) { return setRpcClientDebug(std::move(clientFd), keepAliveBinder); } status_t BBinder::setRpcClientDebug(android::base::unique_fd socketFd, const sp<IBinder>& keepAliveBinder) { status_t BBinder::setRpcClientDebug(unique_fd socketFd, const sp<IBinder>& keepAliveBinder) { if (!kEnableRpcDevServers) { ALOGW("%s: disallowed because RPC is not enabled", __PRETTY_FUNCTION__); return INVALID_OPERATION; Loading libs/binder/BpBinder.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ namespace android { using android::binder::unique_fd; // --------------------------------------------------------------------------- RpcMutex BpBinder::sTrackingLock; Loading Loading @@ -318,7 +320,7 @@ status_t BpBinder::pingBinder() return transact(PING_TRANSACTION, data, &reply); } status_t BpBinder::startRecordingBinder(const android::base::unique_fd& fd) { status_t BpBinder::startRecordingBinder(const unique_fd& fd) { Parcel send, reply; send.writeUniqueFileDescriptor(fd); return transact(START_RECORDING_TRANSACTION, send, &reply); Loading libs/binder/FdTrigger.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <binder/Functional.h> #include "FdUtils.h" #include "RpcState.h" #include "Utils.h" Loading @@ -33,7 +34,7 @@ using namespace android::binder::impl; std::unique_ptr<FdTrigger> FdTrigger::make() { auto ret = std::make_unique<FdTrigger>(); #ifndef BINDER_RPC_SINGLE_THREADED if (!android::base::Pipe(&ret->mRead, &ret->mWrite)) { if (!binder::Pipe(&ret->mRead, &ret->mWrite)) { ALOGE("Could not create pipe %s", strerror(errno)); return nullptr; } Loading libs/binder/FdTrigger.h +3 −3 Original line number Diff line number Diff line Loading @@ -17,10 +17,10 @@ #include <memory> #include <android-base/unique_fd.h> #include <utils/Errors.h> #include <binder/RpcTransport.h> #include <binder/unique_fd.h> namespace android { Loading Loading @@ -61,8 +61,8 @@ private: #ifdef BINDER_RPC_SINGLE_THREADED bool mTriggered = false; #else base::unique_fd mWrite; base::unique_fd mRead; binder::unique_fd mWrite; binder::unique_fd mRead; #endif }; } // namespace android Loading
include/binder/unique_fd.h 0 → 120000 +1 −0 Original line number Diff line number Diff line ../../libs/binder/include/binder/unique_fd.h No newline at end of file
libs/binder/Binder.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ #include <atomic> #include <set> #include <android-base/unique_fd.h> #include <binder/BpBinder.h> #include <binder/IInterface.h> #include <binder/IPCThreadState.h> Loading @@ -28,6 +27,7 @@ #include <binder/Parcel.h> #include <binder/RecordedTransaction.h> #include <binder/RpcServer.h> #include <binder/unique_fd.h> #include <pthread.h> #include <inttypes.h> Loading @@ -43,6 +43,8 @@ namespace android { using android::binder::unique_fd; constexpr uid_t kUidRoot = 0; // Service implementations inherit from BBinder and IBinder, and this is frozen Loading Loading @@ -167,8 +169,7 @@ status_t IBinder::getDebugPid(pid_t* out) { return OK; } status_t IBinder::setRpcClientDebug(android::base::unique_fd socketFd, const sp<IBinder>& keepAliveBinder) { status_t IBinder::setRpcClientDebug(unique_fd socketFd, const sp<IBinder>& keepAliveBinder) { if (!kEnableRpcDevServers) { ALOGW("setRpcClientDebug disallowed because RPC is not enabled"); return INVALID_OPERATION; Loading Loading @@ -273,7 +274,7 @@ public: std::set<sp<RpcServerLink>> mRpcServerLinks; BpBinder::ObjectManager mObjects; android::base::unique_fd mRecordingFd; unique_fd mRecordingFd; }; // --------------------------------------------------------------------------- Loading Loading @@ -640,7 +641,7 @@ status_t BBinder::setRpcClientDebug(const Parcel& data) { } status_t status; bool hasSocketFd; android::base::unique_fd clientFd; unique_fd clientFd; if (status = data.readBool(&hasSocketFd); status != OK) return status; if (hasSocketFd) { Loading @@ -652,8 +653,7 @@ status_t BBinder::setRpcClientDebug(const Parcel& data) { return setRpcClientDebug(std::move(clientFd), keepAliveBinder); } status_t BBinder::setRpcClientDebug(android::base::unique_fd socketFd, const sp<IBinder>& keepAliveBinder) { status_t BBinder::setRpcClientDebug(unique_fd socketFd, const sp<IBinder>& keepAliveBinder) { if (!kEnableRpcDevServers) { ALOGW("%s: disallowed because RPC is not enabled", __PRETTY_FUNCTION__); return INVALID_OPERATION; Loading
libs/binder/BpBinder.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ namespace android { using android::binder::unique_fd; // --------------------------------------------------------------------------- RpcMutex BpBinder::sTrackingLock; Loading Loading @@ -318,7 +320,7 @@ status_t BpBinder::pingBinder() return transact(PING_TRANSACTION, data, &reply); } status_t BpBinder::startRecordingBinder(const android::base::unique_fd& fd) { status_t BpBinder::startRecordingBinder(const unique_fd& fd) { Parcel send, reply; send.writeUniqueFileDescriptor(fd); return transact(START_RECORDING_TRANSACTION, send, &reply); Loading
libs/binder/FdTrigger.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <binder/Functional.h> #include "FdUtils.h" #include "RpcState.h" #include "Utils.h" Loading @@ -33,7 +34,7 @@ using namespace android::binder::impl; std::unique_ptr<FdTrigger> FdTrigger::make() { auto ret = std::make_unique<FdTrigger>(); #ifndef BINDER_RPC_SINGLE_THREADED if (!android::base::Pipe(&ret->mRead, &ret->mWrite)) { if (!binder::Pipe(&ret->mRead, &ret->mWrite)) { ALOGE("Could not create pipe %s", strerror(errno)); return nullptr; } Loading
libs/binder/FdTrigger.h +3 −3 Original line number Diff line number Diff line Loading @@ -17,10 +17,10 @@ #include <memory> #include <android-base/unique_fd.h> #include <utils/Errors.h> #include <binder/RpcTransport.h> #include <binder/unique_fd.h> namespace android { Loading Loading @@ -61,8 +61,8 @@ private: #ifdef BINDER_RPC_SINGLE_THREADED bool mTriggered = false; #else base::unique_fd mWrite; base::unique_fd mRead; binder::unique_fd mWrite; binder::unique_fd mRead; #endif }; } // namespace android