BinderClientTransport may call shutdownInternal to report many types of errors during the connection handshake, for example:
- "Wire format version mismatch"
- "Malformed SETUP_TRANSPORT data"
- SecurityPolicy failed to evaluate or returned permission denied
- connect timeout
- and other errors, if
shutdownNow() is called externally
But BinderClientTransport's handshake sequence doesn't call setOutgoingBinder() until the very end. This means that calls to shutdownInternal() -> sendShutdownTransaction() return without sending anything because outgoingBinder == null.
Maybe this was intentional but I can't think of why. It does mean that the peer's BinderServerTransport object and resources are tied up until the handshake timeout elapses (default 120s). Better IMHO would be to call setOutgoingBinder() right away so that the server can promptly give up on the connection too.