Allow disabling ro.adb.nonblocking_ffs via an ro system property, which
gets overridden by the currently supported persist.adb.nonblocking_ffs.
Bug: http://b/128679787
Test: mma
Change-Id: I28891d2da129e9654bf63ab8a4c330c4d2f5b336
Previously, we were initializing IoBlock::pending when submitting a read,
but leaving it uninitialized when doing a write, which would sometimes
result in an assertion firing when we received a previously allocated
block of memory that happened to have a nonzero value in pending.
Test: treehugger
Change-Id: I434c65f554ceed313fea9cfcc98788908f3ca8bc
When we introduced __adb_check_server_version() as a function
returning a 'bool', we missed missed converting once instance
of "return -1;" to "return false;". Thus, we're returning 'true'
in this case as our non-zero value gets implicitly converted to
'true'.
We fix this case as well with this CL.
Test: TreeHugger
Change-Id: I90b01567d927f36d2d963561b676b3bfabfcee49
Windows has int32_t return codes, which results in return codes 128-255
being sign extended into a negative number. Manually truncate the return
codes we get to preserve their values.
Test: test_device.py on windows
Change-Id: If41d6d469350301704f6ecff72ad17b412db3e04
As there is no security guarantee when the device is unlocked,
allowing adb root gives us more rooms to debug a USER build images.
Also, this makes it possible to run VTS on a USER build GSI, with
setting ro.debuggable=1 and unlocking the device.
This basically re-lands a reverted change:
https://android-review.googlesource.com/c/platform/system/core/+/437815
Which isn't needed after we moved /sbin/adbd to /system/bin/adbd in
USERDEBUG GSI. But it's still needed for USER build GSI.
Bug: 126493225
Test: unlock a USER build device, check 'adb root' can work
Change-Id: I93f12c8a3fe65c96c947e4602795eadfe591c521
If a device is unplugged, a BIND will happen without an ENABLE until the
device is plugged in, which would previously result in adbd crashing
every 5 seconds due to an attempt to join a thread that hadn't been
started.
Bug: http://b/128255355
Test: manually observed adbd via serial cable while unplugged
Change-Id: I90d6384e7e829df1ffaf73a95f2418a2ff97fb03
Our servers can comfortably run more than 16 emulators, and this is
much easier than messing with hypervisors or docker port allocation.
Assumes you know how to avoid clashes with Google Wear's default port.
Test: manual - still registers emulators.
Change-Id: I47cfd28725a550de0bd77fd11fcd94cdd11d2cc2
1. Don't clear O_CLOEXEC on an fd we're duping to stdin/out/err: dup2
does that for us if oldfd != newfd, and we know the fd can't be
stdin/out/err.
2. Use unique_fd.
3. Remove gotos by breaking the remount logic into its own function.
Test: mma
Change-Id: If9929e7f20de445322fd498e1379a2d4e572cb52
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