If we have multiple keys available for authentication (ADB_VENDOR_KEYS
+ the one in ~/.android), we will still have keys in our list of
avilable keys after we've successfully connected. A subsequent
reconnection will start authorizing using the list of keys after the
key that actually worked, resulting in that session being unauthorized
until another reconnection happens. Clear the key list before
reconnecting to fix this. (We could do this after successfully
connecting, but we need to do this before reconnecting anyway, because
our connection could have died during authorization.)
Bug: http://b/117267347
Test: `adb connect foo; adb -s foo reconnect device` with ADB_VENDOR_KEYS
Change-Id: Ieb7dcc28e333c89ae0d75f97e89bcd1b571cb299
This reverts commit 1272e7a592.
Reason for revert: All notice fix changes have been merged and running peacefully for a sustained period. Now this can be reverted for good.
Change-Id: I74e4e291a504fcb9a14ae50e916e494c7359db34
The --fastdeploy switch caused errors when CRC collisions were present in the input apk and/or
an apk with a similar package name to the input apk was already installed on the device.
Test: mm -j 64
Test: adb install -r --fastdeploy --force-agent --local-agent /mnt/raid/boat-attack-apk/boat-attack-swappy.apk
Bug: 119934862
Change-Id: Ibfe0cec38bdbb7371803fc2f73b0ec1697cef624
Removes a few more Android.mk files.
Test: check for adb, mkbootfs, and fastboot in the build artifacts
Change-Id: Ie4e50a363a734d0b9207f0d0098c54719f038e76
An adbkey/adbkey.pub pair that doesn't match up results in a
hard-to-diagnose scenario where "Always allow from this computer"
doesn't work. The private key contains all of the information that's
in the public key, so just extract the public key out of the private
key instead of storing them separately.
Bug: http://b/119634232
Test: rm ~/.android/adbkey.pub; adb kill-server; adb shell true
Test: rm ~/.android/adbkey*; adb kill-server; adb shell true
Change-Id: I0ae9033dbcd119c12cfb2b3977f1f1954ac800c1
Large opportunistic writes would perform a write without updating
writable_ or waking up the polling thread, which resulted in the worker
thread never polling with POLLOUT.
Test: adb_benchmark
Change-Id: Ifed3b97a4b647b539dcd2df858572fa7da9a22d0
Iccfe3bd4fe45a0319bd9f23b8cbff4c7070c9f4d changed Block from using
malloc to std::make_unique, which does the equivalent of
`new char[size]()`, which value initializes the array members to 0.
Switch to `reset(new char[size])` to avoid this costly initialization.
Test: adb_benchmark
Change-Id: I09aacb949a7bd4a946ce35a8ee65d1f451577b72
It's possible to build against an SDK that's newer than the OS that
we're actually running via Xcode update, and Apple increments the
unversioned IOKit interface IDs to the newest version on every release,
which leads to mysterious failures to acquire an interface.
Pin the interface versions to IOUSBFamily 5.0.0, which shipped on OS X
10.7.3.
Bug: http://b/119264733
Test: ./test_device.py
Change-Id: Id26760bc62c89a1f7ef67511b21f9d9252ab69f3
Regression introduced commit bb1efbd1c6
By not first checking if overlayfs mount on /system is in /proc/mounts
remount fails to discover the override and take the selected action.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: I1f0bae22caae1bca84fc1e33b508b54d98f4ed5c
This reverts commit d3bf1a8d7e.
Reason for revert: Now Soong can handle NOTICE files for static libraries.
Bug: 36073965
Test: mma + visual check
Change-Id: I52ebd3518f4d15800f878a6401df2c3a2d6713eb
The version bump we did wasn't actually needed, since adbd doesn't
check for either feature flag we added. Revert the change and clarify
the comment suggesting the version bump when adding features.
Test: ./test_adb.py
Test: ./test_device.py
Change-Id: I92e7f392bcb36b3bf9a236f2d31ba5133de8d72a
This patch addresses two issues with adb remount.
First, the blk_device field in fstab_rec will be incorrect if referring
to a device-mapper node (fs_mgr_update_logical_partition must be
called).
Second, devices that are not system-as-root now move their mount point
and chroot to "/" during first-stage init. However, the fstab entry will
have "/system" as its mount point. The new logic now reflects this.
Bug: N/A
Test: adb remount on hikey or device with dynamic partitions
Change-Id: I48b379db49d2def555ea49888c4994fbcf501672
sysconf(_SC_GETPW_R_SIZE_MAX) may return −1 if there is no hard limit
on the the buffer size. Some libc implementations such as musl don't
define this limit and will return -1.
Use a default buffer size to handle this case.
Change-Id: I997b13a2c2dca00574e049a259135e61c8ed8e03
Signed-off-by: Robert Yang <decatf@gmail.com>
This should fix the bloody Mac build, which doesn't have <error.h>. Since
we weren't entirely happy with error(3) anyway, switch to the toybox
style of error_exit and perror_exit, which are slightly briefer and quite
a bit more intention-revealing.
Bug: N/A
Test: builds
Change-Id: Ic8e411906c363af51657da5ce947b25a0b6bb1f3
* changes:
adbd: implement a nonblocking USB Connection.
adbd: rename daemon/usb.cpp to daemon/usb_legacy.cpp.
adbd: open functionfs ep0 as O_RDWR.
adbd: extract functionfs fd creation.
Implement a Connection that implements a nonblocking interface to
functionfs, to replace the existing implementation that uses two
threads that loop and call read and write respectively. The existing
implementation is vulnerable to a race condition that can occur when a
connection is terminated, where one thread can notice failure and
complete reinitialization of the USB endpoints before the other thread
noticed anything went wrong, resulting in either the first packet
coming from the other end disappearing in to the void, or the other end
getting a packet of garbage.
As a side benefit, this improves performance on walleye from:
push 100MiB: 10 runs: median 49.48 MiB/s, mean 50.00 MiB/s, stddev: 2.77 MiB/s
pull 100MiB: 10 runs: median 75.82 MiB/s, mean 76.18 MiB/s, stddev: 6.60 MiB/s
to:
push 100MiB: 10 runs: median 73.90 MiB/s, mean 73.51 MiB/s, stddev: 5.26 MiB/s
pull 100MiB: 10 runs: median 105.90 MiB/s, mean 107.19 MiB/s, stddev: 6.10 MiB/s
Test: python test_device.py
Change-Id: I9b77c1057965edfef739ed9736e5d76613adf60a
Previously, we were relying on tests run previously to set the main
thread ID, which fails when the tests are sharded.
Test: for i in `seq 0 4`; do GTEST_SHARD_INDEX=$i GTEST_TOTAL_SHARDS=5 /data/nativetest64/adbd_test/adbd_test; done
Change-Id: I15ce70b4598b6ffcf3f5467d16c917f23f668daf
Let's use LOG(FATAL)/PLOG(FATAL) for actual fatal stuff.
Add a Windows error(3) and move folks who didn't really mean "abort"
fatal over to it. Also get rid of syntax_error which wasn't adding a
lot of value, and most of the places it was adding "usage: " didn't seem
entirely appropriate anyway.
In particular, we seemed to have confused fastdeploy.cpp into aborting
in most user error cases, and none of the reviewers noticed. Clearly
we'd all lost track of far too many options.
(I've also cleaned up a few random instances of fprintf(3) + exit(2).)
Bug: N/A
Test: manual
Change-Id: I3e8440848a24e30d928de9eded505916bc324786
Extract common functionality that will be useful for implementing a
nonblocking Connection for functionfs.
Test: mma
Change-Id: Iae4f3d55b2f56568d4a5138db9a2af5622eb83ad