summaryrefslogtreecommitdiffstats
path: root/adb/adb.h
Commit message (Collapse)AuthorAgeFilesLines
* More adb buffer fixes.Elliott Hughes2015-05-011-1/+2
| | | | | | | | | | | | | | This patch factors out a lot of the basic protocol code: sending OKAY, sending FAIL, and sending a length-prefixed string. ADB_TRACE has been non-optional for a long time, so let's just remove the #ifs. Also actually build the device tracker test tool (and remove its duplicate). Bug: http://b/20666660 Change-Id: I6c7d59f18707bdc62ca69dea45547617f9f31fc6 (cherry picked from commit e67f1f87d9b1188ec8617035db7006c37ee7b21e)
* More fixed-length buffer removal.Elliott Hughes2015-04-301-2/+0
| | | | | | Bug: http://b/20666660 Change-Id: I0c738e9fed2defed48a9cf2d0a4f7b99c08dcf3d (cherry picked from commit 6452a89aa8934231e12ab77e0d90f12c3e892ad1)
* Remove extern "C" barriers to using C++.Elliott Hughes2015-04-171-20/+6
| | | | Change-Id: Ic046d6aa540738cb46b54531bc59ba3b47b0136d
* Revert "Revert "adb: support /oem partition""Elliott Hughes2015-03-161-3/+0
| | | | | | | | | | This reverts commit 6084a0124f868c7ec43f6c415a27a168f27ff694. The original build breakage is fixed by (a) building the verity code for eng builds as well as userdebug builds and (b) moving the exported remount service functions into a new header file. Change-Id: Ice0c4f97d4db38ab7eb333c7a6e56bbd11123f5b
* Move adb to C++.Dan Albert2015-03-091-3/+3
| | | | | | | | | | | | | | | | | I keep trying to clean things up and needing std::strings. Might as well just do this now. usb_linux_client.c is going to stay as C because GCC isn't smart enough to deal with the designated initializers it uses (though for some reason it is in C mode). The Darwin files are staying as C because I don't have a way to test that they build. The Windows files are staying as C because while I can actually build for them, it's slow and painful. Change-Id: I75367d29205a9049d34460032b3bb36384f43941
* Move transport declarations into transport.h.Dan Albert2015-02-241-46/+8
| | | | | | There are a few cloexec issues in here as an added bonus. Change-Id: I1699d719d733f47878bdba0454230cf5ab6a60b6
* Move adb_main to its own file.Dan Albert2015-02-181-0/+1
| | | | Change-Id: If6e98c089b39f73bd8f4a878a82669bfeee367f3
* Move the adb auth code into its own file.Dan Albert2015-02-181-0/+5
| | | | Change-Id: I84cf0bd7777f0147119e7c6afc4096c2e93156a2
* Add extern "C" to all the adb headers.Dan Albert2015-02-181-0/+8
| | | | Change-Id: Iaefa3e18d6ee2e065eb97271a796613b2a8e7d6e
* Begin moving code from adb to libadb.Dan Albert2015-01-261-0/+1
| | | | | | | | | | | | | Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes made to adb rarely get ported to the other two, so the trees have diverged a bit. We'd like to stop this because it is a maintenance nightmare, but the divergence makes this difficult to do all at once. For now, we will start small by moving common files into a static library. Hopefully some day we can get enough of adb in here that we no longer need minadb. Bug: 17626262 Change-Id: Ic8d5653bfcc0fec4e1acbece124402355084b864
* Fix disable-verity when the underlying block device is ROSami Tolvanen2015-01-051-1/+1
| | | | | | | | | | | If verity is enabled and the underlying block device is marked read-only, disable-verity fails. We cannot use the existing code for enable-verity to make the device writable as the device in /proc/mounts will be the verity device instead of the underlying device we want to change. This change makes the correct device writable when altering verity state. Change-Id: I423ee50fb34d78cff2fe843318b9081c03c5142d
* Add adb enable-verityPaul Lawrence2014-12-091-1/+3
| | | | | | | | | | | Note that it is *easy* to break your phone with this feature. It is not a bug that reenabling verity after changing one byte of the system partition stops the device booting. (cherry-pick of 7c442e1700e6312727283db402dec6f666f1b55a.) Bug: 18529433 Change-Id: I632e91281884471a362960f1ba30312d2669b8ff
* Revert "Revert "Enable verity on userdebug, and add disable-verity to adb""Paul Lawrence2014-12-091-0/+1
| | | | | | | | | | | This reverts commit 152d2d4234ba89e0c20c4af13e291b6049a7bc33. Fixed build error, and also fixed memory leak spotted from warning. (cherry-pick of bbb36319119edde9377fb80015235893c30d2bc9.) Bug: 17691572 Change-Id: I23b5ba537f7b557432041d4338b38b9be434e981
* Add more debug information.leozwang2014-12-091-0/+3
| | | | | | | | | | | | Re-commit https://googleplex-android-review.googlesource.com/#/c/519430/ Add fix for win_sdk build. Add socketpair debug log. Also output thread information in log on host side. (cherry-pick of adb09fa01a16d8c5c92c2f8d325e1678c531223f.) Change-Id: I21021bc111a3f7362a91b70593e3738125878118
* Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN.Elliott Hughes2014-11-211-1/+0
| | | | Change-Id: I9e25ac9d27e95b04fb8bf7a66c619af0139d8b8f
* Consolidate adb trace macro defines into its own header file.leozwang2014-07-291-103/+1
| | | | | | | | Most code is copied and pasted from adb.h. Any file can just include it to enable tracing. Removed some duplications. Change-Id: Ie1ed9e9edbf92158aac84669fbcbf7dc85fe2cf0
* Redirect debug output to logcat.leozwang2014-07-231-1/+25
| | | | | | If ADB_TRACE is enabled, debug output will be redirected to logcat. Change-Id: I9c36ada7690a2b946ecd6a926d04e36a8313c36a
* add sideload-host mode to adbDoug Zongker2014-07-071-1/+1
| | | | | | | | | | | | | The sideload-host mode turns the host into a server capable of sending the device various pieces of the file on request, rather than downloading it all in one transfer. It's used to support sideloading OTA packages to devices without the need for them to hold the whole package in RAM. If the connected device doesn't support sideload-host mode, we fall back to the older sideload connection. Change-Id: I5adaedd8243dc3b76414bba0149879ca2bbf35fa
* Merge "Add "exec" service: shell commands with no pty."Jeff Sharkey2014-06-021-6/+6
|\
| * Add "exec" service: shell commands with no pty.Jeff Sharkey2014-05-301-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To facilitate device scripts that want to read/write binary data from the host side, this change introduces a new "exec" service that behaves like "shell" but without creating a pty, which would otherwise mangle binary data. After forking, it hooks up stdin/stdout of the child process to the socket connected through to the host. The adb transport doesn't support shutdown(), so the host can't half-close the socket and wait for device termination. Instead, the host side now has two explicit commands "exec-in" and "exec-out" for either sending or receiving data. Teach host side copy_to_file() to deal with stdin/stdout special cases. Switch device side backup/restore services to use the new create_subproc_raw under the hood. Change-Id: I5993049803519d3959761f2363037b02c50920ee
| * am 4639ae45: am a0ce4e28: am 98fdcfa9: am 67cb61ee: Merge "adb: Check ↵Nick Kralevich2013-12-191-1/+7
| |\ | | | | | | | | | | | | | | | | | | sender\'s socket id when receiving packets." * commit '4639ae452e7d22343053c5127ecb44ef19b7baf2': adb: Check sender's socket id when receiving packets.
| * | adb: deprecate legacy log service interfaceMark Salyzyn2013-12-101-2/+0
| | | | | | | | | | | | Change-Id: If96019cc13b3d7a4dcd7785c7137e0cbcc622981
* | | adb: implement "adb reverse <local> <remote>"David 'Digit' Turner2014-05-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the logical opposite of 'adb forward', i.e. the ability to reverse network connections from the device to the host. This feature is very useful for testing various programs running on an Android device without root or poking at the host's routing table. Options and parameters are exactly the same as those for 'adb forward', except that the direction is reversed. Examples: adb reverse tcp:5000 tcp:6000 connections to localhost:5000 on the device will be forwarded to localhost:6000 on the host. adb reverse --no-rebind tcp:5000 tcp:6000 same as above, but fails if the socket is already bound through a previous 'adb reverse tcp:5000 ...' command. adb reverse --list list all active reversed connections for the target device. Note: there is no command to list all reversed connections for all devices at once. adb reverse --remove tcp:5000 remove any reversed connection on the device from localhost:5000 adb reverse --remove-all remove all reversed connections form the current device. Reversed connections are tied to a transport, in other words, they disappear as soon as a device is disconnected. Simple testing protocol: adb forward tcp:5000 tcp:6000 adb reverse tcp:6000 tcp:7000 nc -l localhost 7000 in another terminal: echo "Hello" | nc localhost 5000 Will print "Hello" on the first terminal. Change-Id: I761af790cdb06829b68430afa4145a919fa0e6d5
* | | adb: deprecate legacy log service interfaceMark Salyzyn2014-01-271-2/+0
| |/ |/| | | | | | | | | (cherry picked form commit c66a7537df987715acc77eed952111cc56b7e72b) Change-Id: If96019cc13b3d7a4dcd7785c7137e0cbcc622981
* | adb: Check sender's socket id when receiving packets.David 'Digit' Turner2013-12-161-1/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handle_packet() in adb.c didn't check that when an A_WRTE packet is received, the sender's local-id matches the socket's peer id. This meant that a compromised adbd server could sent packets to the host adb server, spoofing the identity of another connected device if it could "guess" the right host socket id. This patch gets rid of the issue by enforcing even more checks to ensure that all packets comply with the description in protocol.txt. + Fix a bug where closing a local socket associated with a remote one would always send an A_CLSE(0, remote-id, "") message, though protocol.txt says that should only happen for failed opens. The issue was that local_socket_close() called remote_socket_close() after clearing the remote socket's 'peer' field. The fix introduces a new asocket optional callback, named 'shutdown' that is called before that, and is used to send the A_CLSE() message with the right ID in remote_socket_shutdown(). Also add some code in handle_packet() to detect invalid close commands. Change-Id: I9098bc8c6e81f8809334b060e5dca4fc92e6fbc9
* adb: Handle adb connect in a threadBenoit Goby2013-04-251-1/+1
| | | | | | | | | adb connect calls connect() in the event loop. If you pass a wrong ip address or the server is slow to respond, this will block the event loop and you can't even kill the adb server with adb kill-server. Handle connect requests in a service thread instead. Change-Id: I2ee732869a3dc22a6d3b87cf8ac80acaa7790037
* adb: Cleanup dead codeBenoit Goby2013-04-241-4/+1
| | | | | | | dns_service is unused and recover_service has been replaced by adb sideload Change-Id: Ie90000d7f672e8299ee1622a9690c7371b214dc1
* adb: Add "unauthorized" connection stateBenoit Goby2013-01-151-0/+1
| | | | | | | Add a new connection state, so that devices, that require confirmation to allow adb, appear as "unauthorized" in the adb devices lists. Change-Id: Ib4264bc5736dedecf05bcf8e31896f4d7a91fad8
* adb: Create private key with 0600 modeBenoit Goby2012-08-311-1/+1
| | | | | | | Changed key name to force generating new pairs. Bug: 7092477 Change-Id: I680cb9dd1896ae52b2b29d63533f966e033d823f
* adb: Add public key authentificationBenoit Goby2012-08-231-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Secure adb using a public key authentication, to allow USB debugging only from authorized hosts. When a device is connected to an unauthorized host, the adb daemon sends the user public key to the device. A popup is shown to ask the user to allow debugging once or permanantly from the host. The public key is installed on the device in the later case. Other keys may be installed at build time. On the host, the user public/private key pair is automatically generated, if it does not exist, when the adb daemon starts and is stored in $HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed, the ADB_KEYS_PATH env variable may be set to a :-separated (; under Windows) list of private keys, e.g. company-wide or vendor keys. On the device, vendors public keys are installed at build time in /adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys. ADB Protocol change: If the device needs to authenticate the host, it replies to CNXN packets with an AUTH packet. The AUTH packet payload is a random token. The host signs the token with one of its private keys and sends an AUTH(0) packet. If the signature verification succeeds, the device replies with a CNXN packet. Otherwise, it sends a new AUTH packet with a new token so that the host can retry with another private key. Once the host has tried all its keys, it can send an AUTH(1) packet with a public key as payload. adbd then sends the public key to the framework (if it has been started) for confirmation. Change-Id: I4e84d7621da956f66ff657245901bdaefead8395
* Revert "adb: Add public key authentification"Benoit Goby2012-08-201-12/+2
| | | | This reverts commit f4ed516643ee8ed3a59ad1a8048f7ce5f47f93fb.
* adb: Add public key authentificationBenoit Goby2012-08-161-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Secure adb using a public key authentication, to allow USB debugging only from authorized hosts. When a device is connected to an unauthorized host, the adb daemon sends the user public key to the device. A popup is shown to ask the user to allow debugging once or permanantly from the host. The public key is installed on the device in the later case. Other keys may be installed at build time. On the host, the user public/private key pair is automatically generated, if it does not exist, when the adb daemon starts and is stored in $HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed, the ADB_KEYS_PATH env variable may be set to a ;-separated list of private keys, e.g. company-wide or vendor keys. On the device, vendors public keys are installed at build time in /adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys. ADB Protocol change: If the device needs to authenticate the host, it replies to CNXN packets with an AUTH packet. The AUTH packet payload is a random token. The host signs the token with one of its private keys and sends an AUTH(0) packet. If the signature verification succeeds, the device replies with a CNXN packet. Otherwise, it sends a new AUTH packet with a new token so that the host can retry with another private key. Once the host has tried all its keys, it can send an AUTH(1) packet with a public key as payload. adbd then sends the public key to the framework (if it has been started) for confirmation. Change-Id: Idce931a7bfe4ce878428eaa47838e5184ac6073f
* Merge "FunctionFS: initial implementation"Benoit Goby2012-06-061-0/+11
|\
| * FunctionFS: initial implementationAndrzej Pietrasiewicz2012-05-311-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the second version of a patch which demonstrates the possibility of using adbd (Android Debug Bridge daemon) with a generic FunctionFS gadget instead of a custom adb usb gadget in the Linux kernel. It contains changes introduced after Benoit's review - thank you Benoit. The patch adds a new usb access layer to adbd using FunctionFS. The former usb access method is still available. The method is chosen at runtime depending if /dev/usb-ffs/adb/ep0 or /dev/android_adb is accessible. How to use on the target device: $ insmod g_ffs.ko idVendor=<vendor ID> iSerialNumber=<some string> $ mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000 $ ./adbd This patch requires a patch to bionic which adds <linux/usb_functionfs.h> which is an exact copy of the relevant file in the linux kernel. Change-Id: I4b42eb267ffa50fca7a5fba46f388a2f083e8b2d Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [benoit@android.com: detect at runtime if functionfs is mounted or fallback using f_adb] Signed-off-by: Benoit Goby <benoit@android.com>
* | am 2ca3e6b3: adb: Generalizing -s to take qualifiers.Scott Anderson2012-06-051-1/+1
|\ \ | | | | | | | | | | | | * commit '2ca3e6b35f79136418ebc32fef57580698dbd045': adb: Generalizing -s to take qualifiers.
| * | adb: Generalizing -s to take qualifiers.Scott Anderson2012-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | am e82c2db0: adb: Transmit key properties in banner of connect messageScott Anderson2012-06-051-0/+2
|\ \ \ | |/ / | | / | |/ |/| * commit 'e82c2db05cae70a0490a1f84b7211ef42c329671': adb: Transmit key properties in banner of connect message
| * adb: Transmit key properties in banner of connect messageScott Anderson2012-06-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | protocol.txt says that the connect message should have three fields: <systemtype>:<serialno>:<banner> In reality, what is transmitted is simply: <systemtype>:: The serialno is obtained via other means so doesn't really need to be a part of the connect message. This change puts the ro.product.name, ro.product.model and ro.product.device properties in the <banner> for devices. Each property is terminated by a semicolon (;) with the key and value separated by an equals sign (=). Example message: device::ro.product.name=<prd>;ro.product.model=<mdl>;ro.product.device=<dev>; Making this change will enable the device list to provide more information to the user and to give the potential for being able to select which device to talk to with the -s option. Change-Id: I09200decde4facb8fc9b4056fdae910155f2bcb9 Signed-off-by: Scott Anderson <saa@android.com>
* | am 9526a788: Merge "adb: Add ability to specify device path" into ics-aahScott Anderson2012-05-011-2/+3
|\ \ | |/ | | | | | | * commit '9526a788a6bd528e14622404e8750bdcc147d15a': adb: Add ability to specify device path
| * adb: Add ability to specify device pathScott Anderson2012-04-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For manufacturing and testing, there is a need to talk to whatever device is connected to a given port on the host. This change modifies adb's "-s" option to take either a serial number or a device path. The device paths of the connected devices can be listed using "adb devices -l" whose output will resemble: List of devices attached 016B75D60A00600D usb:2-5 device 3031D0B2E71D00EC usb:1-4.3 device The second column lists the device paths. If the -l option is not given, the output from "adb devices" will be the same as it used to be (i.e. the paths will not be printed). The device path can also be obtained with the get-devpath command: $adb -s 3031D0B2E71D00EC get-devpath usb:1-4.3 Note that the format of the device paths are platform dependent. The example above is from Linux. On OS-X, the paths will be "usb:" followed by hex digits. For other platforms, the device paths will be printed as "????????????" and the -s option will not be able to select a device until someone implements the underlying functionality. Change-Id: I057d5d9f8c5bb72eddf5b8088aae110763f809d7 Signed-off-by: Scott Anderson <saa@android.com>
* | adb: Don't synchronize with transport using sleepBenoit Goby2012-03-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Enables ADBD tracing in the emulator.Vladimir Chtchetkine2012-02-271-0/+15
| | | | | | | | | | | | | | | | | | | | When running inside the emulator, guest's adbd can connect to 'adb-debug' qemud service that can display adb trace messages on condition that emulator has been started with '-debug adb' option. This CL enables that functionality in ADB code. Change-Id: I59b4a76d3c887ad28b8aa8e2a01dfa814e75faa1
* | add "adb sideload" and sideload connection stateDoug Zongker2012-01-101-0/+1
|/ | | | | | | | | | Recovery will soon support a minimal implementation of adbd which will do nothing but accept downloads from the "adb sideload" command and install them. This is the client side command (mostly resurrected out of the old circa-2007 "adb recover" command) and the new connection state. Change-Id: I4f67b63f1b3b38d28c285d1278d46782679762a2
* Revert "adb: kick the transport after sending the "adb root" command"Mike Lockwood2011-06-221-7/+1
| | | | | | | | | This reverts commit d15e6ac95dc898fb78fb5917bb2e4498b40b716f. Also increment adb version to 1.0.29 Change-Id: I890643f0c18a2fe90f170134df039c54116cecda Signed-off-by: Mike Lockwood <lockwood@android.com>
* adb: Update version to 1.0.28Mike Lockwood2011-06-211-1/+1
| | | | | Change-Id: Ib8a98d3840abf24cf062112aca7ce462a0f44bc5 Signed-off-by: Mike Lockwood <lockwood@android.com>
* adb: kick the transport after sending the "adb root" commandMike Lockwood2011-06-121-0/+6
| | | | | | | | | | 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>
* Add 'adb restore' to parallel 'adb backup'Christopher Tate2011-05-171-1/+5
| | | | | | | | | It won't actually do anything until the 'bu' tool and framework are updated to respond properly, but this is the adb side of the necessary infrastructure: we copy the tarfile into the socket pointed at the device, using the existing mechanisms. Change-Id: Ic3b5779ade256bd1ad989a94b0685f7b1a7d59d2
* Add 'adb backup' for pulling a full backup tarfile to the hostChristopher Tate2011-04-271-1/+2
| | | | | | | The direct command interfaces with the 'bu' binary in /system/bin on the device. Change-Id: I4cd69eedfe5144c47277573c5626c6ad8755d70b
* adb: fix subprocess exit handling, oom adjust fixes, extra debugging.JP Abgrall2011-03-281-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Revert "Fix adb hang when subprocess dies early."JP Abgrall2011-02-231-34/+4
| | | | | | | | This is for http://b/3482112 "adb interactions with device causing test harness failures". This reverts commit 69c5c4c45bd4f1575ae8bdba13795297be7deb8c. Change-Id: I630bf2e04d2ecf0223bd2af4e87136754ff880d3