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

Commit 51ed14ee authored by Steven Moreland's avatar Steven Moreland
Browse files

RPC Binder: clearer errors for wrong transact type

Bug: 423127919 # this bug error is totally different
 than this case. If we hit this case, we would have
 gotten a different harder error. However, I found
 this while looking at this bug.
Test: binderRpcTest
Flag: EXEMPT bug fix
Change-Id: I3e0db452ebeed1a520ffc0181ed3577eb38bea9a
parent 8443b19b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -665,6 +665,9 @@ status_t RpcState::transactAddress(const sp<RpcSession::RpcConnection>& connecti
            waitUs = 1;
        }

        // This is restricted to "CONTROL_ONLY" because we should not receive any
        // nested transactions until the entire transaction is sent and starts
        // executing.
        return drainCommands(connection, session, CommandType::CONTROL_ONLY);
    };
    if (status_t status = rpcSend(connection, session, "transaction", iovs, countof(iovs),
@@ -888,7 +891,12 @@ status_t RpcState::processCommand(

    switch (command.command) {
        case RPC_COMMAND_TRANSACT:
            if (type != CommandType::ANY) return BAD_TYPE;
            if (type != CommandType::ANY) {
                ALOGE("CommandType %d, but got RPC command %d.", static_cast<int>(type),
                      command.command);
                (void)session->shutdownAndWait(false);
                return BAD_TYPE;
            }
            result = processTransact(connection, session, command, std::move(ancillaryFds));
            break;
        case RPC_COMMAND_DEC_STRONG: