summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorScott Anderson <saa@android.com>2012-05-31 12:04:23 -0700
committerScott Anderson <saa@android.com>2012-05-31 14:06:07 -0700
commit3608d832425ca3a6d00c4040f3bb979c5aa49899 (patch)
tree9668977bd7fa814458b56218ca37091f7bacd945 /adb
parentc7993af64baec271a238646bc20aaa846866c4a9 (diff)
downloadsystem_core-3608d832425ca3a6d00c4040f3bb979c5aa49899.zip
system_core-3608d832425ca3a6d00c4040f3bb979c5aa49899.tar.gz
system_core-3608d832425ca3a6d00c4040f3bb979c5aa49899.tar.bz2
adb: Fix two problems with device path implementation.
The commands that use "host-serial:<serial-number>:<request>" service did not handle "-s usb:<path>". The -s parameter is passed as the serial number in the protocol and then matched against either the serial number or device path. However, skip_host_serial() in sockets.c did not know about the usb: syntax, the serial number was parsed incorrectly. Before this change: $ adb -s usb:1-4.1 get-state error: unknown host service After: $ adb -s usb:1-4.1 get-state device Code was added in find_transport() in transport.c to match device paths, but find_transport() is only used for socket connections so matching device paths is not needed. Change-Id: I922cec963659dafadd0fbc8fa36dee3b55fe366c Signed-off-by: Scott Anderson <saa@android.com>
Diffstat (limited to 'adb')
-rw-r--r--adb/sockets.c4
-rw-r--r--adb/transport.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/adb/sockets.c b/adb/sockets.c
index df223b1..a73fc62 100644
--- a/adb/sockets.c
+++ b/adb/sockets.c
@@ -598,6 +598,10 @@ unsigned unhex(unsigned char *s, int len)
char *skip_host_serial(char *service) {
char *first_colon, *serial_end;
+ if (!strncmp(service, "usb:", 4)) {
+ return strchr(service + 4, ':');
+ }
+
first_colon = strchr(service, ':');
if (!first_colon) {
/* No colon in service string. */
diff --git a/adb/transport.c b/adb/transport.c
index 70fc58e..9c63640 100644
--- a/adb/transport.c
+++ b/adb/transport.c
@@ -922,9 +922,6 @@ atransport *find_transport(const char *serial)
if (t->serial && !strcmp(serial, t->serial)) {
break;
}
- if (t->devpath && !strcmp(serial, t->devpath)) {
- break;
- }
}
adb_mutex_unlock(&transport_lock);