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

Commit c587f02c authored by Luis Hector Chavez's avatar Luis Hector Chavez
Browse files

adb: Avoid waiting for emulator connections

This change exempts the emulator connections from
WaitableConnection.WaitForConnection(). This is because emulator
connections are a) more reliable and b) handled a bit differently than
normal TCP connections.

Bug: 78991667
Test: emulator -showkernel ; adb shell
Change-Id: I552946198889a82d6c265f45e8c3b38f6ac9d045
parent 49b7f296
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1040,6 +1040,11 @@ int register_socket_transport(int s, const char* serial, int port, int local) {
    auto waitable = t->connection_waitable();
    register_transport(t);

    if (local == 1) {
        // Do not wait for emulator transports.
        return 0;
    }

    return waitable->WaitForConnection(std::chrono::seconds(10)) ? 0 : -1;
}