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

Commit bc5f64fb authored by Steven Moreland's avatar Steven Moreland
Browse files

RPC Binder: log transaction failures

If there is a transaction failure, it may cause
subsequent transactions to fail, so log every time.

This is a low level error, so it should not generally
be hit except in DEAD_OBJECT case.

Bug: 414720799
Test: binderRpcTest
Change-Id: I9ddeb9c53f9affc213c24c158ac7401a06196886
parent f615cf31
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -538,7 +538,16 @@ status_t RpcState::transact(const sp<RpcSession::RpcConnection>& connection,
    uint64_t address;
    if (status_t status = onBinderLeaving(session, binder, &address); status != OK) return status;

    return transactAddress(connection, address, code, data, session, reply, flags);
    if (status_t status = transactAddress(connection, address, code, data, session, reply, flags);
        status != OK) {
        // TODO(b/414720799): this log is added to debug this bug, but it could be a bit noisy, and
        // we may only want to log it from some cases moving forward.
        ALOGE("RPC protocol error during call to binder: %p code: %" PRIu32 " transaction: %s",
              binder.get(), code, statusToString(status).c_str());
        return status;
    }

    return OK;
}

status_t RpcState::transactAddress(const sp<RpcSession::RpcConnection>& connection,