Replace direct logic in support for 'adb remount' with an exec out to
/system/bin/remount to do the heavy lifting. Remount success and
failure strings are reported by the adb remount service in response
to the various reported errors, freeing up the remount command itself
from the legacy of script expectations.
Test: adb-remount-test.sh
Bug: 122602260
Change-Id: I686fa465f463b881bbb38f709d780a95e463be80
Reduce the operation sizes to sizes that are small enough that the
kernel will run the OOM killer to try to make them succeed. Compensate
for the smaller operation sizes by increasing the queue depth.
Bug: http://b/126582877
Test: benchmark_device.py
Change-Id: I4d351f56c8f83fea882614238cc3fec8ba1e9bf9
The kernel does a kmalloc of the write size for each write during
io_submit, which can lead to failure if the kernel's heap is fragmented
such that it can't allocate a contiguous 1MB chunk. Partition writes
into 16 page chunks which are much more likely to succeed.
Bug: http://b/126582877
Test: test_device.py
Change-Id: Ib2d48561594e1d81f1a2f62e34eaa40265ac47c4
* changes:
adb: switch sockets.cpp to ConsumePrefix.
adbd: switch abb to ConsumePrefix.
adb: increment server version.
adb: wait for device to disconnect upon `adb root`.
adb: implement wait-for-disconnect.
adb: tell the client what transport it received.
adbd: switch daemon/services to ConsumePrefix.
adb: switch host_service_to_socket to string_view.
adb: switch handle_host_request to string_view.
adb: switch adb_io.h to string_view.
adb: add helper to consume a prefix on a string_view.
adb: make ParseUint reject garbage at the end by default.
Increment the server version for adb_connect with transport id, and
wait-for-disconnect.
Bug: http://b/124244488
Test: none
Change-Id: Ib50d289b68fce4befbf1f5d9507d7e6f9cc1f4f5
Previously, there was a race where if adb root took longer than 3
seconds to take effect, we'd return early and allow subsequent commands
to be targeted at the still-not-dead transport, and spuriously fail.
Bug: http://b/124244488
Test: test_device.py
Change-Id: I791a4f82946eb28e4d37729ab0ed3b7fc05b42a2
Prerequisite for making `adb root` wait for the device that it told to
restart to disappear: the client needs to know which transport to wait
on.
Bug: http://b/124244488
Test: manual
Change-Id: I474559838ad7c0e961e9d2a98c902bca3b60d6c8
It's error-prone to manually writing code of the following form:
if (foo.starts_with("some_prefix:")) {
foo.remove_prefix(strlen("some_prefix:"));
}
Add a helper to do that for us.
Test: mma
Change-Id: I5df391deba8b6c036fcbf17a1f1c79af8d9abd2b
This is corresponding to exec: command of adb and allows for simplifed calls
to binder without shell protocol.
Bug: 111621042
Test: manual
Change-Id: Id6935cd53e351388ecf6d2d15f3a204cb871536a
For the purpose of on-boarding all the other tests,
skip test_reconnect for now.
Test: atest -v adb_integration_test_adb
Bug: 123247844
Change-Id: I50269272adbfc3f946d71bae13677546566d541f
Switch to the nonblocking FFS implementation that fixes several race
conditions on connect/disconnect.
Test: treehugger
Change-Id: I91fdb9b27152078cb38e610861a05f1fa95aa3a2
Detect kernels that don't support AIO on functionfs endpoints and fall
back to the old legacy implementation.
Test: treehugger
Change-Id: Ice28dcd40c9730ac2dd5e468d065b41c0e076146
This is a useful helper for anyone that's using thread safety
annotations alongside std::condition_variable, extract it from adb and
move it to libbase.
Test: mma
Change-Id: Ic51e2f2a0e6a16628034b29d8ff32bf2155afccd
The reconnection test is spuriously failing on test infrastructure for
unclear reasons, which might be due to a race between the connection
attempt and the first command we send. Insert a sleep to hopefully
reduce the flakiness.
Bug: http://b/123247844
Test: ./test_adb.py (but it didn't fail for me in the first place)
Change-Id: Ic36924c16bae424accfec700af4623794fd1f123
Previously, we were rejecting the flag and failing with EINVAL. File
handles aren't inherited by default, so just ignore the flag.
Bug: http://b/123753498
Test: adb install --streaming foo.apk
Change-Id: I17401fcdd58024956d47a5c4c0c57b06831d9817
Reimplement commit ffc11d3cf3 using
fdevent. The previous attempt was reverted because we were blindly
continuing when revents & POLLIN == 0, which ignored POLLHUP/POLLERR,
leading to spinloops when the opposite end of the file descriptor was
shutdown when we had no data left to read.
This patch reimplements the functionality implemented by that commit
using fdevent, which gets us detection of spin loops for free.
Bug: http://b/74616284
Test: ./test_device.py
Change-Id: I1abd671fef4c29e99dad968aa66bb754ca382578
This is useful for when we don't want to actually store the fdevent
into a separate struct to be able to destroy it, but instead want to
destroy it immediately from the callback.
Test: adb_test
Change-Id: Ief3dbf8ea6a6bd72dc7e73f9ab9b7429e48fc181
The switch to socket_spec_listen broke adbd over TCP, because
socket_spec_listen only listens on localhost.
Bug: http://b/123592649
Test: manual
Change-Id: Id1943ebd7f0059db05ad756fe96189c60ebde337