>From a8e5da5a30290b63a5ead662d5fafa4905e8befc Mon Sep 17 00:00:00 2001
From: Jeremy Chang <jer...@0xlab.org>
Date: Mon, 14 Feb 2011 11:39:39 +0800
Subject: [PATCH] Make adbd listen on network and usb gadget concurrently

Device accessed by adb through usb and network concurrently is possible.
For both interfaces listening case, there will be two threads created.

Signed-off-by: Jeremy Chang <jer...@0xlab.org>
---
 adb/adb.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/adb/adb.c b/adb/adb.c
index d9f96df..7f1b12a 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -946,13 +946,14 @@ int adb_main(int is_daemon, int server_port)
     if (sscanf(value, "%d", &port) == 1 && port > 0) {
         // listen on TCP port specified by service.adb.tcp.port property
         local_init(port);
-    } else if (access("/dev/android_adb", F_OK) == 0) {
-        // listen on USB
-        usb_init();
     } else {
         // listen on default port
         local_init(DEFAULT_ADB_LOCAL_TRANSPORT_PORT);
     }
+
+    if (access("/dev/android_adb", F_OK) == 0) {
+        usb_init();
+    }
     init_jdwp();
 #endif
 
-- 
1.7.1


_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to