History log of /system/core/adb/sockets.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
66086a586f80e394674eb171d683d0d9677e3abf 13-Jun-2012 Benoit Goby <benoit@android.com> am 504dccec: am aeceb517: adb: Fix adb tcpip command

* commit '504dccec97c12283f348838ba0bf88536322ee6b':
adb: Fix adb tcpip command
aeceb5174502659cb4fff6de924b54ef7e6cdae7 12-Jun-2012 Benoit Goby <benoit@android.com> adb: Fix adb tcpip command

When running "adb tcpip 5555", adb create a service socket named
"tcpip:5555". Only compare the 6 first chars "tcpip:" to decide if
we enable exit_on_close.

Bug: 6650130
Change-Id: I0835973de044f1cfde0e859ff0277c0ccc2630a3
/system/core/adb/sockets.c
0e9e13eb46d8ffbb456f937db4a8fb0da02dd5d2 06-Jun-2012 Scott Anderson <saa@android.com> am 2ca3e6b3: adb: Generalizing -s to take qualifiers.

* commit '2ca3e6b35f79136418ebc32fef57580698dbd045':
adb: Generalizing -s to take qualifiers.
2ca3e6b35f79136418ebc32fef57580698dbd045 31-May-2012 Scott Anderson <saa@android.com> adb: Generalizing -s to take qualifiers.

Prior to this change, -s could take either a serial number or a
device path (e.g. "-s 01498B1F02015015" or "-s usb:1-4.2"). This
change extends -s to also allow product, model or device names
(e.g. "-s product:mysid"). These new qualifiers will only be
available on devices that are running an adb daemon that provides
properties in the connect message per Change-Id:
I09200decde4facb8fc9b4056fdae910155f2bcb9

The product, model and device are derived from the
ro.product.name, ro.product.model and ro.product.device
properties respectively. They are prefixed with "product:",
"model:" or "device:" as appropriate. In addition, any
non-alphanumerics in the model are changed to underscores.

If the -s parameter matches multiple devices, the result will be
the same as when multiple devices are connected but no -d, -e or
-s option is specified. In general, this means the user will get
"error: more than one device". However for get-state,
get-devpath and get-serialno, they will get "unknown".

The format of "devices -l" was changed to list all of the
qualifiers that are available. The following example output
(with the last digits of the serial numbers replaced with X's) is
with a Galaxy Prime with an older adb daemon and another Galaxy
Prime and Galaxy S both with the enhanced adb daemons:

List of devices attached
016B75D60A0060XX device usb:2-5 product:mysid model:Galaxy_Nexus device:toro
3731B535FAC200XX device usb:1-4.2 product:soju model:Nexus_S device:crespo
01498B1F020150XX device usb:1-4.1

Note that the serial number and state are now column oriented
instead of tab delimited. After the serial number and state, all
qualifiers are listed with each preceded by a space. The output
of the original devices command (without -l) is unchanged.

Change-Id: Iceeb2789874effc25a630d514a375d6f1889dc56
Signed-off-by: Scott Anderson <saa@android.com>
/system/core/adb/sockets.c
e5867141c9364596fbcd47195aeff5b0f9844435 01-Jun-2012 Scott Anderson <saa@android.com> am 3608d832: adb: Fix two problems with device path implementation.

* commit '3608d832425ca3a6d00c4040f3bb979c5aa49899':
adb: Fix two problems with device path implementation.
3608d832425ca3a6d00c4040f3bb979c5aa49899 31-May-2012 Scott Anderson <saa@android.com> 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>
/system/core/adb/sockets.c
f91259a8f0d75d721761d588a4b811427565c984 30-Mar-2012 JP Abgrall <jpa@google.com> adb: fix non-linux builds. tcpip:, root:, usb: are not for ADB_HOST

The handling of adb root:/tpcip:/usb: is normally only for non-ADB_HOST.
This avoids getuid() being invoked on windows builds.

Change-Id: I365b81d9f70de99b9347d3eac82e690a8ac5e747
/system/core/adb/sockets.c
d7f1feb5c8c76838b822d093983cc8a3f57a9b2d 30-Mar-2012 JP Abgrall <jpa@google.com> adb: fix exit of "adb root" when it is a no-op.

"adb root" creates a socket, then starts the service.
Socket creation should not set the exit_on_close when the service will be
a no-op.

Bug: 6259353
Change-Id: Ie526d2fad64f39a48051ed0ff6fb3405c2802ced
/system/core/adb/sockets.c
f366b3698b409405e1ee88476d1186f29fe14b06 16-Mar-2012 Benoit Goby <benoit@android.com> adb: Don't synchronize with transport using sleep

Services that cause adbd to reboot are currently implemented this way:
write(fd, response)
close(fd)
sleep(1)
exit(1)
sleep(1) is necessary to leave time for the transport to transmit
the response before the daemon exits. This is slow and unreliable.
Instead, add a flag to the asocket to make it exit the daemon only
after the socket is closed.

Change-Id: I9df45ea6221f0d9b828703b9b2316a5d4fe59352
/system/core/adb/sockets.c
07edefe4cecbddaf6282e556e04a1e1ef21c404a 22-Jun-2011 Mike Lockwood <lockwood@android.com> Revert "adb: kick the transport after sending the "adb root" command"

This reverts commit d15e6ac95dc898fb78fb5917bb2e4498b40b716f.

Also increment adb version to 1.0.29

Change-Id: I890643f0c18a2fe90f170134df039c54116cecda
Signed-off-by: Mike Lockwood <lockwood@android.com>
/system/core/adb/sockets.c
5b811fa5dd00288954f15209a56aea03d5e4a004 10-Jun-2011 Christopher Tate <ctate@google.com> Tidy up the end-of-data handling in backup

* Increase transfer buffer size to 32K
* Add logging about error conditions and fd teardown
* Pass the fd number as a command line option to the 'bu' subprocess
* Properly harvest the 'bu' subprocess after it's done

Change-Id: Id44dde25778ecf43c5604fd9d01d726ba58861e5
/system/core/adb/sockets.c
b0a8aae3eda5e245b93cb6d3af286202dc8c011c 16-Jun-2011 Kenny Root <kroot@google.com> Use adb_sleep_ms for Cygwin compat

Change-Id: Iabb2cddfb6740a35e4b6b1563a81b64972c29453
/system/core/adb/sockets.c
d15e6ac95dc898fb78fb5917bb2e4498b40b716f 12-Jun-2011 Mike Lockwood <lockwood@android.com> adb: kick the transport after sending the "adb root" command

This is needed because the USB driver on the device no longer resets the bus
when exits and restarts.
Since the host side adb no longer detects that adbd has restarted we need
to reset the connection on the host side now.

Change-Id: I1a8eabd292e8b45c34fa07a8a8b8c609cc15648d
Signed-off-by: Mike Lockwood <lockwood@android.com>
/system/core/adb/sockets.c
37b9fc6e7c25e4d7f57e1df6954498c8bc3c5a1b 09-Jun-2011 Nick Kralevich <nnk@google.com> am 4ba5a8ac: am eafcbe10: am 072a0fac: Merge "Fixed adb crash due to accessing freed memory"

* commit '4ba5a8acba033127befd184f2f78cf0580995b07':
Fixed adb crash due to accessing freed memory
49f1857dd8b64cdd57f28e965a1ff5fa0c2b0547 13-May-2011 Tom Marlin <tomm@bsquare.com> Fixed adb crash due to accessing freed memory

Reset peers to NULL after closing them down. This prevents
other code from attempting to access that freed memory
(which prevents crashes). Previously, it left pointers to
freed memory and the "if (s->peer)" guards could not block
the attempt to access that memory later. Resolves many
crashes seen while taking repeated screenshots on WinXP.

Change-Id: I32553f4d19f6ddc9b05b6ab4dc1e9efe69e5be4f
/system/core/adb/sockets.c
112445b8a752ce174f36cf853d5f1c356c3f5286 13-Apr-2011 JP Abgrall <jpa@google.com> adb: Don't allow a forced exit if data is still in the socket


Fixes the http://b/4271011 "adb shell cat /init.rc output gets truncated"


Change-Id: I6df64374b60789595fb18f96d429315dec032443
Signed-off-by: JP Abgrall <jpa@google.com>
/system/core/adb/sockets.c
e994f18c53673cac42ed45ccb3d427bd40000948 16-Mar-2011 Terence Haddock <thaddock@google.com> In serial, skip over port as well if numbers found after colon.

Change-Id: Icd45f570a9527790eb0cd614a3f77da1a72375b1
/system/core/adb/sockets.c
408fa57864c01113deaa213e5c1848a9c594ae92 16-Mar-2011 JP Abgrall <jpa@google.com> adb: fix subprocess exit handling, oom adjust fixes, extra debugging.

* Add support for correctly handling subprocess termination in shell service (b/3400254 b/3482112 b/2249397)
- have a waitpid() track the subprocess, then notify the fdevent via a socket
- force an eof on the pty master in fdevent's new subproc handler.
- modify fdevent to force-read the pty after an exit.
* Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections, where it
belongs.
* Fix the race around OOM adjusting.
- Do it in the child before exec() instead of the in the parent as the
child could already have started or not (no /proc/pid/... yet).
* Allow for multi-threaded D() invocations to not clobber each other.
- Allow locks across object files.
- Add lock within D()
- Make sure sysdesp init (mutex init also) is called early.
* Add some missing close(fd) calls
- Match similar existing practices near dup2()
* Add extra D() invocations related to FD handling.
* Warn about using debugging as stderr/stdout is used for protocol.
* Fix some errno handling and make D() correctly handle it.
* Add new adb trace_mask: services.
* Make fdevent_loop's handle BADFDs more gracefully (could occur some subproc closed its pts explicitely).
* Remove obsolete commandline args reported in help. (b/3509092)


Change-Id: I928287fdf4f1a86777e22ce105f9581685f46e35
/system/core/adb/sockets.c
28e1390e688f721e13a9877d3c41884bf151db60 16-Mar-2011 Terence Haddock <thaddock@google.com> In serial, skip over port as well if numbers found after colon.

Change-Id: Icd45f570a9527790eb0cd614a3f77da1a72375b1
/system/core/adb/sockets.c
0e7c4274c687446dbe30a814278d7a6b99da8c4e 24-Feb-2011 JP Abgrall <jpa@google.com> Revert "Fix adb hang when subprocess dies early."

This is for http://b/3482112 "adb interactions with device causing test harness failures".

This reverts commit 69c5c4c45bd4f1575ae8bdba13795297be7deb8c.

Change-Id: I630bf2e04d2ecf0223bd2af4e87136754ff880d3
/system/core/adb/sockets.c
69c5c4c45bd4f1575ae8bdba13795297be7deb8c 18-Feb-2011 JP Abgrall <jpa@google.com> Fix adb hang when subprocess dies early.

* Handling of the subprocess and its FD.
This fixes http://b/3400254 "Many bugreports getting hung at the end in monkey"
- Start up a service thread that waits on the subprocess to terminate,
then closes the FD associated with it.
- Have the event handler select() with a timeout so that it can
detect the closed FD. Select() with no timeout does not return when an FD is closed.
- Have the event handler force a read on the closed FD to trigger the close sequence.
- Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections.
* Fix the race around OOM adjusting.
- Do it in the child before exec() instead of the in the parent as the
child could already have started or not (no /proc/pid/... yet).
* Allow for multi-threaded D() invocations to not clobber each other.
- Allow locks across object files.
- Add lock within D()
* Add some missing close(fd) calls
- Match similar existing practices near dup2()
* Add extra D() invocations related to FD handling.
* Warn about using debugging as stderr/stdout is used for protocol.

Change-Id: Ie5c4a5e6bfbe3f22201adf5f9a205d32e069bf9d
Signed-off-by: JP Abgrall <jpa@google.com>
/system/core/adb/sockets.c
8182829ccb46fc5b043ea258672602dc2928dee2 12-Jun-2010 André Goddard Rosa <andre.goddard@gmail.com> adb: optimize socket-list-walking code

Change-Id: I8bbb8b671c1ce7a2ce736b60b0cdb7b21ccdc372
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
/system/core/adb/sockets.c
8e78dc64d2fedccc77966b0636f7530f452dc7d5 11-Jun-2010 André Goddard Rosa <andre.goddard@gmail.com> adb: remove unneeded assignment of id to zero

... as memory was already obtained zero'ed by calloc().

Change-Id: Ic73bad09b54cb778fd40bdf86bb40888ea504c5f
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
/system/core/adb/sockets.c
c419e2a210ad7e37a1f749f2ab4de7c7f95b90d7 11-Jun-2010 André Goddard Rosa <andre.goddard@gmail.com> adb: clean up 0 --> NULL for pointers

Change-Id: I9216fdf534d807a55dfbc6800b5c3ef5f8c83368
/system/core/adb/sockets.c
dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/system/core/adb/sockets.c
e54eebbf1a908d65ee8cf80bab62821c05666d70 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/system/core/adb/sockets.c
35237d135807af84bf9b0e5b8d7f8633e58db6f5 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/system/core/adb/sockets.c
4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/system/core/adb/sockets.c