Commit graph

2885 commits

Author SHA1 Message Date
Treehugger Robot
17d41711c6 Merge "Change --fastdeploy behaviour" 2018-12-17 11:10:18 +00:00
Henry Daitx
ee01c80afe Change --fastdeploy behaviour
--fastdeploy does not require -r anymore, and reverts to a normal install
if the application is not already on the device.

Bug: 120828611

Test: mm -j72
Test: adb install --fastdeploy --force-agent --local-agent /mnt/raid/boat-attack-apk/boat-attack-swappy.apk
Change-Id: Ice2a71493a34ee7d0debabcce6a9aebb0af79e62
2018-12-14 15:25:15 +00:00
Josh Gao
78f94a39f2 Merge changes I042f25f8,I973f42c5,Icb4acea5
* changes:
  adbd: add source/sink services.
  adb: make `adb raw` bidirectional.
  adb: remove incorrect use of RTTI.
2018-12-13 01:26:49 +00:00
Josh Gao
6eb788298b adbd: add source/sink services.
Add some services that skip the service fd to see how much of a benefit
it'll be to eliminate it.

Test: adb raw source:$((300 * 1024 * 1024)) | pv > /dev/null
Test: dd if=/dev/zero bs=1M count=100 | pv | adb raw sink:$((100 * 1024 * 1024))
Change-Id: I042f25f85b16ae9869cb1f1e306d8671b024ed97
2018-12-12 12:54:28 -08:00
Josh Gao
e89a55dd41 adb: make adb raw bidirectional.
Test: adb raw shell:
Change-Id: I973f42c55c71ffd125e58f76d29100a2d5b0c308
2018-12-12 12:54:28 -08:00
Josh Gao
ce5ce87a66 adb: remove incorrect use of RTTI.
We were dynamic_casting to UsbConnection to check for USB connections,
but the actual type was a BlockingConnectionAdapter wrapping a
UsbConnection, with the result that unplugging an inaccessible (due to
permissions) device on Linux wouldn't make the device go away.

Test: manual
Change-Id: Icb4acea5fd3c3baa9691698686213e122e898e4a
2018-12-12 12:54:03 -08:00
Treehugger Robot
fe3becb56b Merge "Fix performance-for-range-copy warnings" 2018-12-12 17:46:46 +00:00
Tom Cherry
23319ebebf Start using new C++ Fstab class widely
Bug: 62292478
Test: boot
Test: adb-remount-test.sh

Change-Id: Id4715af4c1f03e2cfc67de92d3ea58e933685e51
2018-12-12 17:08:09 +00:00
Chih-Hung Hsieh
1b7b7979af Fix performance-for-range-copy warnings
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I3ad102f2b0f971266d57488a3bd57d312f7ee3e6
2018-12-11 10:51:13 -08:00
Treehugger Robot
bcc2d60826 Merge "Removes ASEC-related install flags" 2018-12-07 18:11:09 +00:00
Patrick Baumann
24439442a8 Removes ASEC-related install flags
Bug: 109941548
Test: install still works
Change-Id: Ibaf87e678217a1ce140b4024d16ceb8d27fadec0
2018-12-07 16:15:31 +00:00
Henry Daitx
f21edf3edd Fix adb not correctly reading return code from DeployAgent
Certain error conditions were getting lost because adb was wrongly
reading DeployAgent's return code as always 0.

Test: mm -j 72
Test: adb install -r --fastdeploy --force-agent --local-agent /mnt/raid/boat-attack-apk/boat-attack-swappy.apk

Bug: 120197330
Change-Id: If835fd6ca2051be8e5ff6c957e08b1e458053989
2018-12-06 15:46:38 +00:00
Treehugger Robot
46d19d34d1 Merge "adb: fix authentication when reconnecting." 2018-12-04 20:41:14 +00:00
Treehugger Robot
239245fe79 Merge "Enable the APEX support on the device side." 2018-12-04 12:29:06 +00:00
Josh Gao
4414e4c728 adb: fix authentication when reconnecting.
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
2018-12-04 01:08:55 -08:00
Treehugger Robot
a7f54b1592 Merge "C++17 is the default now." 2018-12-04 07:53:24 +00:00
Jaewoong Jung
7174ec8fff Merge "Revert "Revert "Revert "adb: append the libwinpthread COPYING to adb's NOTICE."""" 2018-12-03 23:57:42 +00:00
Elliott Hughes
3c59cb8420 C++17 is the default now.
Test: builds
Change-Id: I6814455e9ad2cdcf99ad66de38a3ad0bfb440d80
2018-12-03 09:02:18 -08:00
Josh Gao
919b70cde1 Enable the APEX support on the device side.
Test: on device
Merged-In: Ic6e237556fa059e02cf9c55d1c034947b7dfb405
Change-Id: Ic6e237556fa059e02cf9c55d1c034947b7dfb405
2018-12-03 22:29:52 +09:00
Idries Hamadi
fafd21159c Merge "Fix fastdeploy issues when testing Boat Attack Unity3D demo" 2018-11-30 08:43:05 +00:00
Jaewoong Jung
0e55778f4e Revert "Revert "Revert "adb: append the libwinpthread COPYING to adb's NOTICE."""
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
2018-11-29 23:14:02 +00:00
Idries Hamadi
49cdcfd3f3 Fix fastdeploy issues when testing Boat Attack Unity3D demo
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
2018-11-29 14:16:04 +00:00
Idries Hamadi
484f88bcef Add OWNERS file to fastdeploy so idries@ can approve changes
Test: None
Change-Id: If04c5cadd04b0b866b3e5b73e9e2d5d70db20881
2018-11-28 16:55:00 +00:00
Treehugger Robot
fa105049d8 Merge "adb: stop using adbkey.pub." 2018-11-27 21:35:44 +00:00
Dan Willemsen
3f439a7a88 Switch from dist-for-goals to dist in Android.bp
Removes a few more Android.mk files.

Test: check for adb, mkbootfs, and fastboot in the build artifacts
Change-Id: Ie4e50a363a734d0b9207f0d0098c54719f038e76
2018-11-19 23:06:12 -08:00
Yifan Hong
0e0f818c8a logical -> dynamic partitions.
Reflect a name change.
Test: boots
Bug: 119286600

Change-Id: I076071be18be521eeee4ebae10491b9f3e8ef857
2018-11-16 12:53:18 -08:00
Josh Gao
2dc4cabe06 adb: stop using adbkey.pub.
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
2018-11-15 17:50:57 -08:00
Mark Salyzyn
9f1cf25332 switch to using android-base/file.h instead of android-base/test_utils.h
Test: compile
Bug: 119313545
Change-Id: I4f7ad84743e974b4b4d1d7256088f6c8b749a237
2018-11-14 09:35:34 -08:00
Josh Gao
1289e1ec65 Revert "adb: make benchmarks build on the host."
This reverts commit 80dd70d285.

Breaks the darwin build.

Change-Id: If95266c6fc027cf2a706f3c83dce7e50b762b8aa
2018-11-13 11:28:29 -08:00
Josh Gao
bc4dbfafb1 adb: fix NonblockingFdConnection's behavior with large writes.
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
2018-11-12 20:54:39 -08:00
Josh Gao
10d079a37b adb: fix zero-initialization in Block.
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
2018-11-12 20:54:39 -08:00
Josh Gao
80dd70d285 adb: make benchmarks build on the host.
Test: adb_benchmark
Change-Id: I9afedd7bdcf645652e514d98bb88036753718168
2018-11-12 20:54:30 -08:00
Josh Gao
68b5d0c3e3 adb: flush stderr after logging on Windows.
Test: set ADB_TRACE=1 & adb.exe server nodaemon
Change-Id: Ibb109618be7eaae49461a306e34ff79451ec330e
2018-11-12 14:08:40 -08:00
Josh Gao
cd85556151 adb: libusb: don't set interface alternate setting.
Match behavior with the legacy implementation.

Test: ADB_TRACE=1 adb server nodaemon
Change-Id: If1451871f252ef4499b3bb887e947169f8d2432f
2018-11-12 14:08:40 -08:00
Josh Gao
6a08b2c255 Merge "adb: pin USB interface versions on darwin." 2018-11-09 18:45:52 +00:00
Josh Gao
b35ee22887 adb: pin USB interface versions on darwin.
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
2018-11-08 16:49:46 -08:00
Josh Gao
9c27dde899 Merge "adb: switch version back to 40." 2018-11-08 21:31:54 +00:00
Mark Salyzyn
beb4cb8e43 adb: overlayfs failed to remount /system
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
2018-11-06 09:49:10 -08:00
David Anderson
15e1b3b85a Merge "adbd: Fix adb remount when switching roots during first-stage init." 2018-11-03 03:17:30 +00:00
Jaewoong Jung
c728550de7 Merge "Revert "Revert "adb: append the libwinpthread COPYING to adb's NOTICE.""" 2018-11-02 23:05:49 +00:00
Jaewoong Jung
1272e7a592 Revert "Revert "adb: append the libwinpthread COPYING to adb's NOTICE.""
This reverts commit 6374076ce4.

Reason for revert: The Soong side change broke darwin_mac build.

Change-Id: I8d3c1d4e075c333b4890cb620dd106d16800d7f4
2018-11-02 23:00:50 +00:00
Jaewoong Jung
d465c7e52d Merge "Revert "adb: append the libwinpthread COPYING to adb's NOTICE."" 2018-11-02 22:25:34 +00:00
Jaewoong Jung
6374076ce4 Revert "adb: append the libwinpthread COPYING to adb's NOTICE."
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
2018-11-01 22:33:21 +00:00
Josh Gao
4f911e3bf6 adb: switch version back to 40.
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
2018-11-01 13:25:31 -07:00
bohu
09faa66006 adb: print emulator console output
It is very helpful to see the output of the following adb command:
adb emu <emulator commands...>

Change-Id: I7905370fb955de4d457a323a7e9e780aaca5d45e
2018-10-30 14:36:33 -07:00
Victor Hsieh
02ef4bb190 adb install-multiple to also accept .fsv_sig
.fsv_sig will be fs-verity signature in PKCS#7 format.

Test: adb install-multiple foo.apk foo.apk.fsv_sig
Bug: 112037636
Change-Id: I4a9b2203334d4974602c7f138222ade1aa319ccb
2018-10-29 16:55:06 -07:00
David Anderson
bb1efbd1c6 adbd: Fix adb remount when switching roots during first-stage init.
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
2018-10-26 13:51:32 -07:00
Treehugger Robot
9b6da16849 Merge "adb: Use a default _SC_GETPW_R_SIZE_MAX size" 2018-10-25 00:24:56 +00:00
Robert Yang
88c997d4eb adb: Use a default _SC_GETPW_R_SIZE_MAX size
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>
2018-10-24 15:23:55 -04:00
bohu
ea0c3cbc18 adb: correct tcpip help message
'adb tcpip <mode>' is meant to affect adbd, not
the host adb server.

BUG: 111434128
Change-Id: I78c958bfbede60b20fb7e0f2444e5b21ecb90f7a
2018-10-24 10:38:33 -07:00