[linaro-android] system/core: Make adbd listen on network and usb gadget concurrently

Message ID 20110215063022.GA17460@black
State New
Headers show

Commit Message

Jeremy Chang Feb. 15, 2011, 6:30 a.m.
From a8e5da5a30290b63a5ead662d5fafa4905e8befc Mon Sep 17 00:00:00 2001
From: Jeremy Chang <jeremy@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 <jeremy@0xlab.org>
---
 adb/adb.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Patch

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