From 043912ec1176cb5814174361b4156a8b4393a379 Mon Sep 17 00:00:00 2001 From: Tao Wu Date: Fri, 21 Oct 2016 15:43:57 -0700 Subject: [PATCH] Allow multiple tcp adb connection to same device. This worked before Kitkat, and then we lost this feature in Kitkat. Now I make the register logic in server_socket_thread as same as qemu_socket_thread. Test: manual - build emulator image and connect from different adb client. Bug: 32341562 Change-Id: I7b4831d280048d2a3796be3522bd3b8fbc1ade6b Signed-off-by: Tao Wu --- adb/transport_local.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adb/transport_local.cpp b/adb/transport_local.cpp index ea2bf7747..ba2b28d8b 100644 --- a/adb/transport_local.cpp +++ b/adb/transport_local.cpp @@ -226,7 +226,8 @@ static void server_socket_thread(void* arg) { D("server: new connection on fd %d", fd); close_on_exec(fd); disable_tcp_nagle(fd); - if (register_socket_transport(fd, "host", port, 1) != 0) { + std::string serial = android::base::StringPrintf("host-%d", fd); + if (register_socket_transport(fd, serial.c_str(), port, 1) != 0) { adb_close(fd); } }