summaryrefslogtreecommitdiffstats
path: root/adb/backup_service.c
Commit message (Collapse)AuthorAgeFilesLines
* Add "exec" service: shell commands with no pty.Jeff Sharkey2014-05-301-152/+0
| | | | | | | | | | | | | | | | | | | | 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
* adb: turn on -WerrorMark Salyzyn2014-05-051-4/+1
| | | | | | - Deal with some -Wunused issues Change-Id: Idfd1a114e68ae637978b52fde5144d0dca0ec79f
* Fix hang after end of backupChristopher Tate2011-06-211-4/+17
| | | | | | | | | | | | | | | | | The buggy behavior was that the 'adb backup ....' host command line invocation would hang forever, even after the backup finished and the forked device-side subprocess had been reaped. The reason for this is that the device adbd end of the socketpair used to send the data back from the forked subprocess was still stuck readable even after the remote end of it had been closed. With this patch, the thread whose job it is to waitpid() in order to harvest the forked child process also closes the local (adbd) end of the socketpair. This makes the fdevent logic notice that the socket is dead, at which point it cleans up everything including the communication back to the host. Change-Id: I90e7e4e5db36c5a6f7363708b29a6d2c56d1250e
* Tidy up the end-of-data handling in backupChristopher Tate2011-06-201-7/+42
| | | | | | | | | * 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
* Add 'adb restore' to parallel 'adb backup'Christopher Tate2011-05-171-16/+27
| | | | | | | | | 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
* Use the new 'bu' syntax for backup vs restore operationChristopher Tate2011-05-161-2/+3
| | | | Change-Id: Ib007705ee562a41869f8add3408101b3a53aa2d7
* Add 'adb backup' for pulling a full backup tarfile to the hostChristopher Tate2011-04-271-0/+95
The direct command interfaces with the 'bu' binary in /system/bin on the device. Change-Id: I4cd69eedfe5144c47277573c5626c6ad8755d70b