Commit graph

10 commits

Author SHA1 Message Date
JP Abgrall
69c5c4c45b 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>
2011-02-18 14:16:59 -08:00
David 'Digit' Turner
730ff3b786 adb: improve debug traces readability.
This patch makes the traces easier to read. For example transports are
displayed by name/serial instead of their hex address.

Change-Id: I7e8df44ddbec19754d63d989bd56485998b4627b
2011-01-06 14:11:07 +01:00
Mike Lockwood
cbbe79add1 adb connect and disconnect improvements:
Port number is now optional.  Will use default port 5555 if not specified.
"adb disconnect" with no additional arguments will disconnect all TCP devices.

Change-Id: I7fc26528ed85e66a73b8f6254cea7bf83d98109f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-06-02 11:31:26 -04:00
Mike Lockwood
8cf0d59f61 adb: Add "adb disconnect" command for disconnecting TCP/IP devices.
Also check that device is not already connected in "adb connect"

Change-Id: I5f84b56b63d8c6932f23791cac319fd6bc39d36c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-11 23:04:18 -04:00
Mike Lockwood
ff19670d48 adb: Improved support for running adb over TCP/IP
Added new commands:

adb connect <host>:<port> (to connect to a device via TCP/IP)
adb tcpip <port>          (to restart adbd on the device to listen on TCP/IP)
adb usb                   (to restart adbd on the device to listen USB)

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-24 16:05:58 -07:00
Mike Lockwood
37d3111b1c adb: print better error message when there are insufficient permissions for a device.
Now, a command like "adb shell" will print "insufficient permissions for device"
instead of "device not found" if adb does not have permissions to communicate with the device.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-08 13:53:16 -04:00
Mike Lockwood
0927bf9690 adb: On Linux, detect USB devices for which adb does not have permissions to communicate with.
adb devices will now list devices without adequate file system permissions in /dev/bus/usb as:

List of devices attached
????????????	no permissions

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-08 12:44:35 -04:00
The Android Open Source Project
dd7bc3319d auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
The Android Open Source Project
e54eebbf1a auto import from //depot/cupcake/@135843 2009-03-03 18:29:04 -08:00
The Android Open Source Project
4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00