Commit graph

2478 commits

Author SHA1 Message Date
Jerry Zhang
1171607b60 Merge "adb: Use kernel aio for functionfs." am: aaa90cfe06 am: 6fe5cda8aa
am: 9c5679caf0

Change-Id: Ic43aef9fac9cf1d82168c3fbb0c7b53328358b2e
2017-08-29 03:47:54 +00:00
Jerry Zhang
6fe5cda8aa Merge "adb: Use kernel aio for functionfs."
am: aaa90cfe06

Change-Id: Ia89f076b94c8974544923b64ea53dffd6b8c8397
2017-08-29 03:38:26 +00:00
Treehugger Robot
aaa90cfe06 Merge "adb: Use kernel aio for functionfs." 2017-08-29 03:28:26 +00:00
Josh Gao
151c4adb28 Merge "adb: improve CHECKs." am: 9f38e19b88 am: f628362478
am: 3c186bc32c

Change-Id: I4c30f4f9cd8ac92f38e6640a747227211e7fe528
2017-08-28 23:49:54 +00:00
Josh Gao
f628362478 Merge "adb: improve CHECKs."
am: 9f38e19b88

Change-Id: Icc50ced0faeda5653288922ec787311e30c5085d
2017-08-28 23:40:23 +00:00
Treehugger Robot
9f38e19b88 Merge "adb: improve CHECKs." 2017-08-28 23:35:44 +00:00
Josh Gao
e46720938d adb: improve CHECKs.
Use CHECK_LT(foo, 1234) instead of CHECK(foo < 1234) so that failing
checks have the values emitted.

Bug: http://b/65063965
Test: adb server nodaemon
Change-Id: I094287f7c4d2d177ea216568d06e9e425a28dd96
2017-08-28 14:43:24 -07:00
Josh Gao
ca5f86e084 Merge "adbd: don't spin if file sync read fails." am: 32d2eae8b9 am: 4dc1892491
am: 43898a6add

Change-Id: Icc7d13bc5e7ff2aaf63f95f046734fb77db6d72e
2017-08-28 21:26:43 +00:00
Josh Gao
4dc1892491 Merge "adbd: don't spin if file sync read fails."
am: 32d2eae8b9

Change-Id: Ie104bb8ea8d67b5a7ce896d2237a44cc8ea1ab4f
2017-08-28 21:16:13 +00:00
Josh Gao
1d6c01b53d adbd: don't spin if file sync read fails.
Bug: http://b/64508974
Test: mma
Change-Id: Ifba6a9dea3138b6d2a62c91cc0532f63986c048a
2017-08-28 11:21:31 -07:00
Elliott Hughes
22d9a9a249 Merge "Fix adb tcpip tests." am: d865b655d5 am: 37f256423b
am: 7096d47858

Change-Id: I090e1011627ce618623b132e2624cc1008d2ea1f
2017-08-24 00:59:13 +00:00
Elliott Hughes
37f256423b Merge "Fix adb tcpip tests."
am: d865b655d5

Change-Id: I1b9938c36b59db8ce991928349ba6ee9c8459de1
2017-08-24 00:52:03 +00:00
Elliott Hughes
e163298ef2 Fix adb tcpip tests.
The test was assuming we still output the full help for every syntax error.
While I'm here, make the diagnostics suck less.

Bug: N/A
Test: ran tests
Change-Id: Idc28616f20c66391f32046cf4216f122998a84bd
2017-08-23 15:43:34 -07:00
Felipe Leme
691e5829ce Merge "Don't preserve file attributes when pulling bugreport file..." am: 8570d1db70 am: 009c2ddadc am: 6d6ff64360
am: 589523b7c3

Change-Id: I57e016f4879b8e61e615cc219becb538e650db0b
2017-08-22 23:17:03 +00:00
Felipe Leme
589523b7c3 Merge "Don't preserve file attributes when pulling bugreport file..." am: 8570d1db70 am: 009c2ddadc
am: 6d6ff64360

Change-Id: I4cec50a7ec2c76f355e1f1821564308d88ef5e2a
2017-08-22 23:10:58 +00:00
Treehugger Robot
8570d1db70 Merge "Don't preserve file attributes when pulling bugreport file..." 2017-08-22 22:41:26 +00:00
Josh Gao
37c679ca88 Merge changes I2270cc0a,I55e5dc5a am: 2066e0585e am: 46244a6497 am: 40b849f88a
am: d879c171a0

Change-Id: I3f18e40a4e39246c9f7bc051ad0de4beefaf1b0b
2017-08-22 00:04:22 +00:00
Josh Gao
d879c171a0 Merge changes I2270cc0a,I55e5dc5a am: 2066e0585e am: 46244a6497
am: 40b849f88a

Change-Id: Iee1c51f4b0d78f47afc5f2c1c057f6cf9110dba8
2017-08-21 23:53:22 +00:00
Josh Gao
b0c1802615 adb: add track-devices-l service.
Add a way to get the full `devices -l` output on a continuous basis.

Test: manual
Change-Id: I2270cc0a0d7e1384ce19631724ddf2462d963ade
2017-08-21 14:15:07 -07:00
Josh Gao
b122b17555 adb: allow selection of a specific transport.
Extend device selection to allow selecting a specific transport via
monotonically increasing identifier (visible in devices -l).

This is useful when using multiple devices (like hikey960...) that
have identical bogus serial numbers like 0123456789ABCDEF.

Bug: http://b/37043226
Test: adb -t {1, 2, 9999999} {get-serialno, shell, features}
Change-Id: I55e5dc5a406a4eeee0012e39b52e8cd232e608a6
2017-08-21 14:15:06 -07:00
Josh Gao
90b3a0da5c Merge "adb: fix deadlock in kick_all_transports." am: c2449e871e am: b43479c764 am: 4fd1f04a82
am: f91a9f98ae

Change-Id: Ia3e9ca6107ce4f75d5636bec33f31a73719969f8
2017-08-18 20:17:46 +00:00
Josh Gao
f91a9f98ae Merge "adb: fix deadlock in kick_all_transports." am: c2449e871e am: b43479c764
am: 4fd1f04a82

Change-Id: Iacdf180f5315b5436724433cc65ad6419aebea1e
2017-08-18 20:11:46 +00:00
Treehugger Robot
c2449e871e Merge "adb: fix deadlock in kick_all_transports." 2017-08-18 19:50:32 +00:00
Huihong Luo
f45940ac71 Merge "Fix bug #37284906, adb shell crashes on windows with invalid options. For example, "adb.exe shell -list" crashes without this fix. Test: adb.exe shell -list-packages" am: e275043d38 am: 4be54a4622 am: 94574c4f00
am: 2f19bbe3e9

Change-Id: I15b71beff85d64ae1a80140e96c35ddb0dc44e38
2017-08-18 14:59:52 +00:00
Huihong Luo
2f19bbe3e9 Merge "Fix bug #37284906, adb shell crashes on windows with invalid options. For example, "adb.exe shell -list" crashes without this fix. Test: adb.exe shell -list-packages" am: e275043d38 am: 4be54a4622
am: 94574c4f00

Change-Id: I5e2780f291cf533689338e7216e82d2da364057c
2017-08-18 14:53:51 +00:00
Bowgo Tsai
2a64967b7a Merge "Move adbd from root to system" into oc-mr1-dev
am: 0bb4cb6fa2

Change-Id: I0be7a2d6f0d58add826f61df14a5c6503e77413d
2017-08-18 06:06:49 +00:00
Huihong Luo
af39885c9f Fix bug #37284906, adb shell crashes on windows with invalid options.
For example, "adb.exe shell -list" crashes without this fix.
Test: adb.exe shell -list-packages

Change-Id: I96be44128ff3ecab7804b70074cbde630b3fc3d1
2017-08-17 22:26:46 -07:00
TreeHugger Robot
0bb4cb6fa2 Merge "Move adbd from root to system" into oc-mr1-dev 2017-08-18 03:52:36 +00:00
Josh Gao
1db71afe97 adb: fix deadlock in kick_all_transports.
Previously, kick_all_transports would deadlock if there were any
inaccessible transports, because the transport kick function would call
unregister_usb_transport, which attempts to take the already-held
transport lock.

Fix this by switching the transport lock over to a recursive mutex.

Test: manual
Change-Id: If61296ff4745e1699f3e216811c1383582627604
2017-08-17 13:50:51 -07:00
Ting-Yuan Huang
119f0f8d9c Merge "Fix a potential memory leak" am: f583ff660e am: 6677429bff am: 6deffe3c3b
am: 78a298ce24

Change-Id: If42dc48e4af320026e17365c5263d7629a4eb1b7
2017-08-16 18:00:15 +00:00
Ting-Yuan Huang
78a298ce24 Merge "Fix a potential memory leak" am: f583ff660e am: 6677429bff
am: 6deffe3c3b

Change-Id: Ifcd960527a5da12e136ba96062460208368aafea
2017-08-16 17:34:11 +00:00
Felipe Leme
4bfddbd20e Don't preserve file attributes when pulling bugreport file...
...otherwise it could have weird dates when the device clock is wrong.

Test: m -j32 adb && ./out/host/linux-x86/bin/adb bugreport test.zip && ls -l test.zip
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test

Fixes: 63927360

Change-Id: I3f87277f1acb97212a87b89639e42b6d7d300faa
2017-08-15 18:11:38 -07:00
Ting-Yuan Huang
f26cf6d520 Fix a potential memory leak
Test: Built without seeing the warnings
Change-Id: I934509c78482af9ef7dc447c807f6450484b4b38
2017-08-15 16:48:24 -07:00
Elliott Hughes
d02d846a86 Don't include the build number in the adbd binary.
am: 2e93eda69c

Change-Id: I0f4d330f276c35db94b87ddb95dd627ea5af3051
2017-08-15 20:16:41 +00:00
Elliott Hughes
2e93eda69c Don't include the build number in the adbd binary.
We want repeatable builds for minimal OTAs.

Bug: http://b/64634017
Bug: 64709603 (presubmit balking at the line above)
Test: repeated builds after `touch daemon/main.cpp` keep same md5sum
Change-Id: Iedeb44377ea45bbf20e2212760802198a57dc14a
2017-08-15 20:07:04 +00:00
Bowgo Tsai
93defc17f3 Move adbd from root to system
Bug: 63910933
Test: normal boot sailfish, checks adb works
Test: recovery boot sailfish, checks adb works
Test: normal boot bullhead, checks adb works
Test: recovery boot bullhead, checks adb works

Change-Id: I1b27910c06a4172ca718b3344736ec8e3429f477
2017-08-14 17:59:08 +08:00
Jerry Zhang
ecee434fae adb: Use kernel aio for functionfs.
This method works around the downsides of
ENDPOINT_ALLOC, namely that it is not affected
by memory fragmentation and it uses an upstream
interface.

Also add libasyncio to provide the necessary syscalls
to both adb and mtp.

Add some small optimizations to file_sync.

Bug: 37916658
Test: run adb push/pull
Change-Id: If3b3be02b5e2d4f9cffec1b8ddc02a5768a51a1f
2017-08-10 15:12:47 -07:00
Elliott Hughes
df5ecefde4 Merge "Fix reference to out of scope local in adb_thread_setname." am: b31ca1a64f am: 15d565bbca
am: b664dd38b9

Change-Id: Id2d91a34d11400cdb4b601da745d64209aeb3e71
2017-08-03 00:25:00 +00:00
Elliott Hughes
7462f1858c Fix reference to out of scope local in adb_thread_setname.
Bug: https://android-review.googlesource.com/#/c/168725/5/adb/sysdeps.h@639
Test: boots, adbd thread names look sane
Signed-off-by: Ivan Maidanski <i.maidanski@samsung.com>
Change-Id: Ib3bdf53658f3903de8f0a5688f7d77745e677c77
2017-08-02 20:34:06 +00:00
Josh Gao
60364171da Merge "adbd: add logging to troubleshoot usb issues." into oc-dr1-dev
am: 4ee59e0b51

Change-Id: I418023c78988508c72557f2c7572efa163a174ef
2017-07-27 15:34:59 +00:00
Josh Gao
8f484a6896 adbd: add logging to troubleshoot usb issues.
Bug: http://b/63899881
Bug: http://b/63901259
Bug: http://b/63904904
Test: treehugger
Change-Id: Ifbc3caa6b416093bf8e127194003747c910352dc
(cherry picked from commit 184f571cfd)
2017-07-27 00:34:31 -07:00
Josh Gao
1324a24b26 Merge "adbd: add logging to troubleshoot usb issues." am: 5550901152 am: 07c337bb7d
am: 18e429af26

Change-Id: I85d859b7fd82b56634fe82dd921f875a206c653e
2017-07-27 01:26:13 +00:00
Treehugger Robot
5550901152 Merge "adbd: add logging to troubleshoot usb issues." 2017-07-27 00:17:15 +00:00
Josh Gao
184f571cfd adbd: add logging to troubleshoot usb issues.
Bug: http://b/63899881
Bug: http://b/63901259
Bug: http://b/63904904
Test: treehugger
Change-Id: Ifbc3caa6b416093bf8e127194003747c910352dc
2017-07-26 11:08:15 -07:00
Lennart Wieboldt
e1332dd01b Merge "Remove LOCAL_CLANG and clang: true" am: 80ec81cf4b am: f7b315c985
am: 8a8b97b271

Change-Id: I7e691abe2e2ccec5d9477c528d603c081c0a5661
2017-07-25 22:35:56 +00:00
Lennart Wieboldt
cd15fc7ba8 Remove LOCAL_CLANG and clang: true
clang is the default compiler since Android nougat

Test: mma & verified it´s still build with clang
Change-Id: I34adaeef2f6558a09f26027271222bad94780507
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2017-07-25 14:29:50 +02:00
Bowgo Tsai
9679967dac Merge "adbd: lessen security constraints when the device is unlocked" am: e03665142e am: 0fe0ced23c
am: 620f6e65b3

Change-Id: I532c68a077019cbf133db5cbdcf967509415687b
2017-07-18 02:45:06 +00:00
Bowgo Tsai
f1d3dbc32f adbd: lessen security constraints when the device is unlocked
ALLOW_ADBD_ROOT ('adb root') and ALLOW_ADBD_NO_AUTH (ro.adb.secure = 0)
are false in user build. This prevents a non-A/B device from running
Treble VTS because it requires 'adb root'. Without ALLOW_ADBD_NO_AUTH,
adb still can work if ro.adb.secure = 1. However, allowing it to be 0
is better for test automation.

The image combination in VTS is:
  - system.img (userdebug): provided by Googlg
  - boot.img (user): provided by the OEM  <-- adbd is here
  - vendor.img (user): provided by the OEM

This change allows 'adb root' and 'ro.adb.secure = 0' when the device is
unlocked in user build. No changes for userdebug/eng builds.

Note that the device must be unlocked when running VTS. Otherwise,
verified boot will prevent it from booting the system.img provided by
Google (no verity metadata).

Bug: 63313955
Bug: 63381692
Test: use the above image combination, check 'adb root' and
      'ro.adb.secure = 0' can work

Change-Id: I109d96c950e54c4fb0ac0c98b989a20593681e52
2017-07-18 08:41:19 +08:00
Josh Gao
aabd9a09b5 Revert "adb: turn on libusb by default."
This reverts commit f2f0b31850.

libusb seems to be causing flakiness on some machines. Disable it for
now.

Bug: http://b/62962248
Test: python test_device.py (with DeviceOfflineTest commented out)
Change-Id: Ia9de78ab772c22574cf5ca7facb78f22af6d7a71
(cherry picked from commit 969110ca4a)
2017-06-29 11:22:55 -07:00
Dan Albert
6c95c3edcd Merge "Indicate that a packet was truncated." am: 046160959c am: e76c8020ba
am: c83ec67ec3

Change-Id: I61c12bc6fbcd205c2421831a64ffb783249a2222
2017-06-27 23:06:56 +00:00