From patchwork Tue Feb 15 06:30:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Chang X-Patchwork-Id: 142 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:40:19 -0000 Delivered-To: patches@linaro.org Received: by 10.146.83.12 with SMTP id g12cs331997yab; Mon, 14 Feb 2011 22:30:30 -0800 (PST) Received: by 10.231.33.8 with SMTP id f8mr3729174ibd.88.1297751430161; Mon, 14 Feb 2011 22:30:30 -0800 (PST) Received: from mail-pv0-f178.google.com (mail-pv0-f178.google.com [74.125.83.178]) by mx.google.com with ESMTPS id 38si8857348ibi.91.2011.02.14.22.30.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Feb 2011 22:30:30 -0800 (PST) Received-SPF: pass (google.com: domain of shunyu.chang@gmail.com designates 74.125.83.178 as permitted sender) client-ip=74.125.83.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of shunyu.chang@gmail.com designates 74.125.83.178 as permitted sender) smtp.mail=shunyu.chang@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by pvg6 with SMTP id 6so1288984pvg.37 for ; Mon, 14 Feb 2011 22:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :mime-version:content-type:content-disposition:user-agent; bh=kRr56LhITaGzw9WiFo2g7R0rongHxDlDqQSuxzbwCzI=; b=WbmOIPICYGZeYRGc//tm7LDKnm/b6yjZtNcnjrKrUDNeDRC49crYGqhMp5xqxw1MkI 2dKiww/7l1N7QJCcsKNwXps4cD2kgvIHDEXcX/0qxwx4l+mD/2VdDrteLSKBYHj/j5oX mBp4HIgmRlNu3VV8p/IGfVSduXmLYkZSHfohQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=n7qA60B0f23VM0na+vmPvbc/PsEE+6371CHuulmiF7BBBdJdfu1YdnRNvGK664rQMl xM4pvUasQYqqMoC3E8v8Ql2ZB/hY0HhNlJegR43t77u0BJcNcBAWPEsFjzOiEeoUfe5U jO/golOlXoCwsF/o6SHRJm4DGCqAXVSc6fG2U= Received: by 10.142.199.14 with SMTP id w14mr3870246wff.321.1297751428954; Mon, 14 Feb 2011 22:30:28 -0800 (PST) Received: from black (61-30-10-70.static.tfn.net.tw [61.30.10.70]) by mx.google.com with ESMTPS id e14sm5235666wfg.8.2011.02.14.22.30.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Feb 2011 22:30:27 -0800 (PST) Sender: Shun-Yu Chang Date: Tue, 15 Feb 2011 14:30:22 +0800 From: Jeremy Chang To: linaro-dev@lists.linaro.org Cc: patrik.ryd@linaro.org, asac@linaro.org, patches@linaro.org Subject: [linaro-android][PATCH] system/core: Make adbd listen on network and usb gadget concurrently Message-ID: <20110215063022.GA17460@black> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) >From a8e5da5a30290b63a5ead662d5fafa4905e8befc Mon Sep 17 00:00:00 2001 From: Jeremy Chang 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 --- 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