* 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>
This patch makes the traces easier to read. For example transports are
displayed by name/serial instead of their hex address.
Change-Id: I7e8df44ddbec19754d63d989bd56485998b4627b
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>
Also check that device is not already connected in "adb connect"
Change-Id: I5f84b56b63d8c6932f23791cac319fd6bc39d36c
Signed-off-by: Mike Lockwood <lockwood@android.com>
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>
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>
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>