We're only reading FUNCTIONFS_BIND on creation upon the first creation
of the control fd, which results in an abort when rebind happens (e.g.
when MTP is enabled) and we unexpectedly read FUNCTIONFS_BIND in the
second instantiation of the connection.
This reverts commit 2b668d3906.
Bug: http://b/135155652
Test: manually enabled MTP
Rework the functionfs logic to avoid rebinding the USB interface
repeatedly.
Bug: http://b/133132986
Test: treehugger
Change-Id: I7f75874efd197764d40b66800a117ff4726d793b
We assign string literals directly to argv[0], which leads to fun
explosions when we attempt to free when the runtime can detect that
a bad free happened, which seems to happen reliably with lld.
Bug: http://b/110800681
Test: `adb shell true` on windows
Change-Id: Ica81e472c31686d80b58c41ff6d2b825baef06fb
Which will dump all the allowed properties, similar to `adb shell
getprop`.
Bug: 134027350
Test: Run the command under rescue mode.
Change-Id: Id668224098006d71ee192c8c2bea5d791d2423c1
* changes:
adb: daemon: Assign valid fd to usb_handle ep0 file descriptor
adbd: respond to device-to-host control transfers.
adbd: read, print, and ignore USB control transfers.
non-aio USB read function was stuck in a loop waiting for more data
because data length parameter is always set 64 for fastbootd commands.
It should be a normal case to get less data than expected
since lengths of these commands are usually less than 64.
Add logic to check this and one more parameter to distinguish
fastbootd from general adbd case.
Bug: 133189029
Test: try various fastbootd commands
Change-Id: I6690324840d78f3f1e04235040301520329976db
Merged-In: I6690324840d78f3f1e04235040301520329976db
Failing to write to the endpoint results in subsequent reads on ep0 to
fail with EL2HLT, so do an empty write to fulfill the transfer.
Bug: http://b/131867920
Test: manually tested with modified auto client
Change-Id: If2eec162ca4b31a9974c7bd5802be51cee9e2708
Merged-In: If2eec162ca4b31a9974c7bd5802be51cee9e2708
(cherry-picked from internal commit af086e9a95)
It seems like we're blowing up when receiving a control transfer that's
intended for Android Auto, because we're not expecting to get the data
for the control transfer in a subsequent read.
Bug: http://b/131867920
Test: none
Change-Id: Icfd642e6dfc02d2ccbdd60c39f89e534298c944d
Merged-In: Icfd642e6dfc02d2ccbdd60c39f89e534298c944d
(cherry-picked from internal commit 12807c7012)
Add Microsoft OS Descriptors so that on Windows, we get automatically
registered with the WinUSB driver instead of requiring a different INF
to be used with device with a different vendor ID.
Bug: http://b/68993980
Test: manually changed the vendor ID on a blueline and connected it to a Windows VM
Change-Id: Id78bae270df9805573a90a86019267b53a3c8252
Kernel does not accept non-zero value of iocb->aio_reserved2.
Bug: 132803232
Test: initialize malloc() memory to non-zero pattern and see what breaks
Change-Id: I65a7e89e3a2c1ba79df1dc2d011d6c76c41afb81
Also, improve the logging in the cases where we do abort.
Bug: http://b/131867920
Test: treehugger
Change-Id: If8ec9f4614ce146e6dbd21cc77587ea81658199b
The original commit broke aosp-master-with-phones, because of
vendor libraries the depended on the int versions of libbase functions.
This patch reverts the revert, and also adds ABI-compatibility shims for
the replaced functions.
This reverts commit 2c58e1924a.
Bug: http://b/131312539
Test: treehugger
Test: forrest run of aosp-master-with-phones
Change-Id: I75cc84ec8d963e20862f7662e8e2f409471f41cc
Expect EBUSY for overlayfs teardown, and ENOENT for setup.
Test: adb-remount-test.sh
Bug: 131614849
Change-Id: I0fb351d6d5fe758021c9e9043f57863c7a194c12
adb was already using ConsumePrefix, and now we have another would-be
user in cutils. (There appears to be one place in adb that should use
ConsumeSuffix, so I'm assuming we'll want that sooner or later.)
I've kept these inline because adb and google3's versions both were, and
I'm easily led.
Test: treehugger
Change-Id: I29d99032f6f6ccbfaefece59725db8afb02a4c87
A previous patch intended to make receiving multiple FUNCTIONFS_ENABLEs
non-fatal, but failed to do so because we would try to spawn another
worker thread and hit a different assertion.
Bug: http://b/130638368
Test: echo mem | adb shell "su 0 sh -c 'cat > /sys/power/state'"
Change-Id: I53456112244d8b4f7d26df6ec6961389fca70498
We don't need the public key to be generated at ~/.android/adbkey.pub,
but it's still useful to be able to generate the public key for use with
ADB_VENDOR_KEYS.
Bug: http://b/119634232
Test: manual
Change-Id: Iecd6ff1bba4af4ba142456034f3faf52bb9e017d
Support `adb rescue wipe` command on the host side. This command runs
under the rescue mode and wipes data (and cache/metadata).
Bug: 131037235
Test: run adb rescue wipe
Change-Id: Ib3a3f2d564cc19d0446540d616cc21489ba558c2
This reverts commit 93d63c010a.
Reason for revert: b/131312539 - All aosp-master-with-phones phones failing boot / health check.
Change-Id: Id4239f93484b7d6b8d9bcd355a59cbd40d9766e2
Each operation we submit results in a contiguous allocation in the
kernel which can trigger OOM-killing. Tune the queue depths to reduce
the chances of this happening, with a minimal impact on performance.
Bug: http://b/126582877
Test: ./benchmark_device.py with blueline
Change-Id: I4b0f83d54a9a9a69f0ab48322d78fb137c94dd35
unique_fd's implicit conversion to int has led to tons of problems (see
all of the overloads for close, fdopen, fdopendir, etc.). Add a switch
that can turn it off, and reduce the ridiculous amount of work to fix up
callers by introducing a borrowed_fd type that can be constructed from
either int or unique_fd.
Test: treehugger
Change-Id: If77cf5cbcaddacdaec5919a15b3520fb68f51a62
unique_fd's implicit conversion to int allows the following code to
compile without error, leading to a double close:
std::function<void(unique_fd)> func = [](int x) { close(x); };
func(unique_fd(42));
Test: treehugger
Change-Id: I948ecda3a12738b3af6444fe2902d2f7b80e1b4c