Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ad04154 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "libbinder: consistent user{,debug} symbols" am: 63cb8d02 am: 6b84ed7a

parents 44f049fb 6b84ed7a
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -49,10 +49,11 @@ static_assert(sizeof(IBinder) == 12);
static_assert(sizeof(BBinder) == 20);
static_assert(sizeof(BBinder) == 20);
#endif
#endif


// global b/c b/230079120 - consistent symbol table
#ifdef BINDER_RPC_DEV_SERVERS
#ifdef BINDER_RPC_DEV_SERVERS
constexpr const bool kEnableRpcDevServers = true;
bool kEnableRpcDevServers = true;
#else
#else
constexpr const bool kEnableRpcDevServers = false;
bool kEnableRpcDevServers = false;
#endif
#endif


// Log any reply transactions for which the data exceeds this size
// Log any reply transactions for which the data exceeds this size
@@ -156,7 +157,7 @@ status_t IBinder::getDebugPid(pid_t* out) {


status_t IBinder::setRpcClientDebug(android::base::unique_fd socketFd,
status_t IBinder::setRpcClientDebug(android::base::unique_fd socketFd,
                                    const sp<IBinder>& keepAliveBinder) {
                                    const sp<IBinder>& keepAliveBinder) {
    if constexpr (!kEnableRpcDevServers) {
    if (!kEnableRpcDevServers) {
        ALOGW("setRpcClientDebug disallowed because RPC is not enabled");
        ALOGW("setRpcClientDebug disallowed because RPC is not enabled");
        return INVALID_OPERATION;
        return INVALID_OPERATION;
    }
    }
@@ -201,6 +202,7 @@ public:
    RpcServerLink(const sp<RpcServer>& rpcServer, const sp<IBinder>& keepAliveBinder,
    RpcServerLink(const sp<RpcServer>& rpcServer, const sp<IBinder>& keepAliveBinder,
                  const wp<BBinder>& binder)
                  const wp<BBinder>& binder)
          : mRpcServer(rpcServer), mKeepAliveBinder(keepAliveBinder), mBinder(binder) {}
          : mRpcServer(rpcServer), mKeepAliveBinder(keepAliveBinder), mBinder(binder) {}
    virtual ~RpcServerLink();
    void binderDied(const wp<IBinder>&) override {
    void binderDied(const wp<IBinder>&) override {
        LOG_RPC_DETAIL("RpcServerLink: binder died, shutting down RpcServer");
        LOG_RPC_DETAIL("RpcServerLink: binder died, shutting down RpcServer");
        if (mRpcServer == nullptr) {
        if (mRpcServer == nullptr) {
@@ -226,6 +228,7 @@ private:
    sp<IBinder> mKeepAliveBinder; // hold to avoid automatically unlinking
    sp<IBinder> mKeepAliveBinder; // hold to avoid automatically unlinking
    wp<BBinder> mBinder;
    wp<BBinder> mBinder;
};
};
BBinder::RpcServerLink::~RpcServerLink() {}


class BBinder::Extras
class BBinder::Extras
{
{
@@ -496,7 +499,7 @@ void BBinder::setParceled() {
}
}


status_t BBinder::setRpcClientDebug(const Parcel& data) {
status_t BBinder::setRpcClientDebug(const Parcel& data) {
    if constexpr (!kEnableRpcDevServers) {
    if (!kEnableRpcDevServers) {
        ALOGW("%s: disallowed because RPC is not enabled", __PRETTY_FUNCTION__);
        ALOGW("%s: disallowed because RPC is not enabled", __PRETTY_FUNCTION__);
        return INVALID_OPERATION;
        return INVALID_OPERATION;
    }
    }
@@ -521,7 +524,7 @@ status_t BBinder::setRpcClientDebug(const Parcel& data) {


status_t BBinder::setRpcClientDebug(android::base::unique_fd socketFd,
status_t BBinder::setRpcClientDebug(android::base::unique_fd socketFd,
                                    const sp<IBinder>& keepAliveBinder) {
                                    const sp<IBinder>& keepAliveBinder) {
    if constexpr (!kEnableRpcDevServers) {
    if (!kEnableRpcDevServers) {
        ALOGW("%s: disallowed because RPC is not enabled", __PRETTY_FUNCTION__);
        ALOGW("%s: disallowed because RPC is not enabled", __PRETTY_FUNCTION__);
        return INVALID_OPERATION;
        return INVALID_OPERATION;
    }
    }