summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-08-26 12:50:22 -0700
committerMike Lockwood <lockwood@android.com>2009-08-26 14:46:18 -0700
commitcef31a02544d91b85481a5fa032b6126dbb32365 (patch)
tree43ce798ac81e1fa8ba4f3ef009516333f2e68d0f /adb
parentf71c71148cb65e61ab483b1b0351922c11d862d8 (diff)
downloadsystem_core-cef31a02544d91b85481a5fa032b6126dbb32365.zip
system_core-cef31a02544d91b85481a5fa032b6126dbb32365.tar.gz
system_core-cef31a02544d91b85481a5fa032b6126dbb32365.tar.bz2
adb: Fix emulator support.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'adb')
-rw-r--r--adb/adb.c14
-rw-r--r--adb/adb.h4
2 files changed, 10 insertions, 8 deletions
diff --git a/adb/adb.c b/adb/adb.c
index 9980bad..283ebce 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -851,7 +851,7 @@ int adb_main(int is_daemon)
HOST = 1;
usb_vendors_init();
usb_init();
- local_init();
+ local_init(ADB_LOCAL_TRANSPORT_PORT);
if(install_listener("tcp:5037", "*smartsocket*", NULL)) {
exit(1);
@@ -923,13 +923,15 @@ int adb_main(int is_daemon)
** is not set, otherwise start the network transport.
*/
property_get("service.adb.tcp.port", value, "0");
- if (sscanf(value, "%d", &port) == 0) {
- port = 0;
- }
- if (port == 0 && access("/dev/android_adb", F_OK) == 0) {
+ 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 {
- local_init(port);
+ // listen on default port
+ local_init(ADB_LOCAL_TRANSPORT_PORT);
}
init_jdwp();
#endif
diff --git a/adb/adb.h b/adb/adb.h
index d782751..713666f 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -33,7 +33,7 @@
#define ADB_VERSION_MAJOR 1 // Used for help/version information
#define ADB_VERSION_MINOR 0 // Used for help/version information
-#define ADB_SERVER_VERSION 24 // Increment this when we want to force users to start a new adb server
+#define ADB_SERVER_VERSION 25 // Increment this when we want to force users to start a new adb server
typedef struct amessage amessage;
typedef struct apacket apacket;
@@ -360,7 +360,7 @@ typedef enum {
#define ADB_PROTOCOL 0x1
-void local_init();
+void local_init(int port);
int local_connect(int port);
/* usb host/client interface */