Commit graph

2561 commits

Author SHA1 Message Date
Tim Murray
de47194940 adb: disable checksum on new versions
The checksum is unnecessary. Improves adb performance by 40% on USB2.

Test: new adb works with new + old adbd, old adb works with new adbd
bug 67327728

Change-Id: I761d8a5a62deaea9bbb092ea9926b2d6d312f00d
2017-12-14 14:18:26 -08:00
Elliott Hughes
bf2062f800 Merge "Set $TMPDIR for adb shell." 2017-12-12 00:29:50 +00:00
Treehugger Robot
6f29887c71 Merge "adb: get libusb compiling on Windows." 2017-12-11 19:24:41 +00:00
Elliott Hughes
d42df42f30 Set $TMPDIR for adb shell.
Bug: http://b/19635681
Test: printenv
Change-Id: I21e89b9d7cccad23f32a3062a9e04e59b8278104
2017-12-11 10:40:57 -08:00
Josh Gao
9425996b45 adb: get libusb compiling on Windows.
This still doesn't work yet because libusb doesn't support hotplug on
Windows yet, but it's in the milestones for the next libusb release,
and this is enough to start poking around with the WinUSB device-side
stuff, so leave it broken for now.

Bug: http://b/68993980
Test: set ADB_LIBUSB=1; adb.exe server nodaemon aborts in the expected place
Change-Id: Icef7d46e31c847d6a8e724c6f58ae5db43673c16
2017-12-08 13:11:15 -08:00
Treehugger Robot
a4a9a81d38 Merge "adb: disable USB packet overflow checking on OS X." 2017-12-08 20:31:51 +00:00
Elliott Hughes
3289b9c928 Merge "Add OWNERS." 2017-12-07 23:21:26 +00:00
Elliott Hughes
693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Josh Gao
801048c6ea adb: disable USB packet overflow checking on OS X.
OS X appears to be misreporting the maximum packet size on some
hardware. Disable this on OS X until we figure out what's going on.

Bug: http://b/65063965
Bug: https://issuetracker.google.com/70244520
Test: python test_device.py on linux with CHECK_PACKET_OVERFLOW disabled
Test: python test_device.py on darwin (but on hardware that wasn't reproducing this)
Change-Id: I57e1adfa162e40ed79f71f97af552b3f0519324e
2017-12-06 15:34:41 -08:00
Jim Kaye
42f9a44000 Merge "Fix typos in ADB documentation"
am: 017203b140

Change-Id: I263536093d33e7e1783049834862346e47643723
2017-11-30 21:53:43 +00:00
Jim Kaye
ab74e068ee Fix typos in ADB documentation
Bug: None

Test: None

Change-Id: Ib036eefc602bf0ebac869146b04eea225cae39ef
2017-11-30 10:57:51 -08:00
Elliott Hughes
0b8a47c55a Merge "Remove a duplicate TEMP_FAILURE_RETRY."
am: 166c6a4390

Change-Id: I7bf8f8b7c68ecced7c62122f59623eefe9bab285
2017-11-29 16:12:00 +00:00
Elliott Hughes
166c6a4390 Merge "Remove a duplicate TEMP_FAILURE_RETRY." 2017-11-29 16:06:12 +00:00
Elliott Hughes
3df2fa6d8e Remove a duplicate TEMP_FAILURE_RETRY.
Bug: N/A
Test: builds
Change-Id: I19c2f50422e8a7e0c451a464586553f3e5eaadab
2017-11-28 18:05:27 -08:00
Nick Kralevich
cac2163a6b Merge "Standarize on VFS_CAP_REVISION_2"
am: af03f483d7

Change-Id: If1d0c4aa90cb712168db2252c23e621c3513acfe
2017-11-28 01:11:17 +00:00
Nick Kralevich
65b8d749f7 Standarize on VFS_CAP_REVISION_2
In https://github.com/torvalds/linux/commit/8db6c34f1dbc8 , namespaced
file capabilities were introduced. That change updated VFS_CAP_REVISION
from VFS_CAP_REVISION_2 to VFS_CAP_REVISION_3.

Android code is written assuming v2 capabilities, and the code will
break if we naively try to treat a v2 structure as a v3 structure.
So don't even try.

Android kernels prior to v4.14 will not support this extended capability
structure, so attempting to set such capabilities will ultimately fail.

With 8db6c34f1dbc8, it appears that attempting to read a v3 capabilities
xattr will always downgrade the capability to a v2 capability, so it
really doesn't make sense to look for a v3 capability.

Android capabilities are only created at /system and /vendor filesystem
creation time by host tools. Android processes, within or outside a
namespace, are not permitted CAP_SETFCAP
(https://android-review.googlesource.com/c/platform/system/sepolicy/+/547801/1/public/domain.te
line 1101). So we should never have to deal with a v3 capability other
than those that might appear on the /system / /vendor partition at a
future date by a future author.

Bug: 69617725
Test: build/test/boot/CTS passes
Change-Id: I0378b3f1195dc62dbeb771944ab378c881441118
2017-11-27 14:17:42 -08:00
Sandeep Patil
25f1631aa7 DO NOT MERGE ANYWHERE Add comments and code about ro.boot.slot back
Taimen bootloader passes androidboot.slot for now.
This reverts commit 211a4a5d5a.

Bug: 68710251
Test: taimen successfully mounts partition in first stage
Change-Id: I046afc99120e7ec9ef4b8ea7a852eb70e7231ea9
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-11-10 16:20:27 -08:00
Treehugger Robot
93e5cd85d1 Merge "Move GetDeviceTest from adb's test_device.py to adb package." 2017-11-09 00:57:32 +00:00
Josh Gao
85d4789719 Move GetDeviceTest from adb's test_device.py to adb package.
This test actually belongs with the adb python wrapper, since it's not
affected by changes to adb itself.

Bug: http://b/64260633
Test: python test_device.py
Change-Id: I58e5dff760f35923f8dbbdc7de6ffd75254880dc
2017-11-08 14:39:06 -08:00
Elliott Hughes
6b970212fd Don't include the build number in the adbd binary.
We want repeatable builds for minimal OTAs.

(cherrypick of 2e93eda69cf20d9c04d56ea6bf1e2ea62ad62eb4.)

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-11-07 10:57:36 -08:00
Josh Gao
1f3763ef4a Merge "adb: fix erase-remove_if idiom."
am: c2a2ecb7a5

Change-Id: I98bc2547b3785d8ca14565a6a9b7fac84a7c673e
2017-10-23 21:36:22 +00:00
Treehugger Robot
c2a2ecb7a5 Merge "adb: fix erase-remove_if idiom." 2017-10-23 21:28:32 +00:00
Mark Salyzyn
5966ae2c6b Merge changes I3e6e5a22,I6eb3f066
am: 75836d5e7f

Change-Id: I871260b9cdf7a1ab5f6d39cd8a491cd31cd94a4d
2017-10-23 20:45:02 +00:00
Josh Gao
4dfaa88610 adb: fix erase-remove_if idiom.
This probably doesn't have any actual effect, because there should only
be one smartsocket listener so this will happen to work, but this looks
sketchy.

Test: mma
Test: adb server nodaemon & (sleep 1; adb kill-server)
Change-Id: Id00ab1fc1fc029949c675ae6e3b1a77f3e9e4c69
2017-10-20 18:03:48 -07:00
Mark Salyzyn
8f3b8873b0 adb: cleanup some portions of client usb interfaces
Cleanup to remove open coded functions.

Test: build
Bug: 63736262
Bug: 38446744
Bug: 66912053
Change-Id: I3e6e5a22542934837b6a03523987141dc2776d48
2017-10-13 07:31:49 -07:00
Mark Salyzyn
0a78cc1b76 adb: clang-format for adb.h and client/usb_windows.cpp
Future adjustments triggered cleanup and transition of adb/adb.h and
adb/client/usb_windows.cpp to be moved to Android coding standard.

Test: build
Bug: 63736262
Bug: 38446744
Bug: 66912053
Change-Id: I6eb3f0665b9670b9b3d5f5397f271605b48f4ff0
2017-10-13 07:31:49 -07:00
Elliott Hughes
510552149c Merge "Set $HOSTNAME in adbd."
am: 2364d7ccc5

Change-Id: I40ef480380f250540d6c2856721540400c599111
2017-10-03 22:32:13 +00:00
Elliott Hughes
ba4d9fd933 Set $HOSTNAME in adbd.
bash sets this itself, but mksh doesn't.

This also makes interactive and non-interactive adb shells more similar,
because when we set this in mkshrc that wouldn't affect non-interactive
shells. (I'm not sure whether this is an improvement or not.)

This is certainly _cheaper_ than doing this in mkshrc by calling out to
getprop though.

Bug: N/A
Test: `adb shell printenv` and `adb shell`, `printenv`
Change-Id: I3ff724f19a5098313df83836253f1f7e7872d6a4
2017-10-03 08:44:27 -07:00
Josh Gao
86a919041f Merge "adb: remove SendConnectOnHost."
am: 5eaa5bc081

Change-Id: I899558eb51cda69d9c53288db86cada87a4a0e85
2017-10-02 23:32:49 +00:00
Treehugger Robot
5eaa5bc081 Merge "adb: remove SendConnectOnHost." 2017-10-02 23:27:23 +00:00
Josh Gao
4b5d4da6f6 adb: remove SendConnectOnHost.
This logic appears to be racy, and it shouldn't actually be needed, if
our devices follow the USB spec. Use libusb_set_interface_alt_setting
on device initialization as well, to add one more thing that should
reset the data toggles.

Bug: http://b/32952319
Test: python test_device.py
Change-Id: I392198af3d72c524b893e5056afa2b4617cea49c
2017-10-02 14:38:03 -07:00
Josh Gao
bc3d3625d5 Merge "adbd: improve thread names."
am: 39071a5177

Change-Id: Id41804332dfb81a2bcfd07d3a7180f16e7412bc0
2017-09-29 18:34:17 +00:00
Josh Gao
bcadc77550 adbd: improve thread names.
Name each service thread specifically to improve debuggability.

Bug: http://b/65648324
Test: adb shell debuggerd -b `adb shell pidof adbd` during a sync
Change-Id: I644e25fc2f14a26eafd19f596e4e8f3c2bb79967
2017-09-28 16:45:24 -07:00
Josh Gao
d3f7956f2f Merge "adb: partially revert b5e11415."
am: ef9426d883

Change-Id: I3f7fa1577bc79b5bdcacbeacc7b5141cc9c73cb9
2017-09-27 18:45:18 +00:00
Treehugger Robot
ef9426d883 Merge "adb: partially revert b5e11415." 2017-09-27 18:38:28 +00:00
Tom Cherry
9bc2a967cf Merge "Reland "Remove comments and code about ro.boot.slot""
am: dea5e081ac

Change-Id: Idf32e9600b6a3b93a6a2b4c414cc0193d5d65fb9
2017-09-26 00:08:55 +00:00
Tom Cherry
211a4a5d5a Reland "Remove comments and code about ro.boot.slot"
This reverts commit c5f5fd430a.

Dependencies are now merged.

Bug: 37663204
Bug: 66437505
Change-Id: I84284b6bc37f6aae4096dec73f45ebd85d28ca9d
2017-09-25 16:04:30 +00:00
Tom Cherry
0ff5f16f7b Merge "Revert "Remove comments and code about ro.boot.slot""
am: eb00b1f3aa

Change-Id: If6b511a19009e28a63b52e6701dbc8f7b1f514f7
2017-09-21 18:46:44 +00:00
Tom Cherry
c5f5fd430a Revert "Remove comments and code about ro.boot.slot"
This reverts commit f4ec2c50a3.

Dependencies hadn't been merged yet.

Bug: 66437505
Change-Id: I7551b7f2f184a6fefc39e184a42dc8d323c58b89
2017-09-21 18:37:22 +00:00
Tom Cherry
bf6168fd53 Merge "Remove comments and code about ro.boot.slot"
am: 7dcf076700

Change-Id: Ic28c5bd369d45489150741b1c1cf2b4c00c4eb52
2017-09-20 19:27:43 +00:00
Tom Cherry
f4ec2c50a3 Remove comments and code about ro.boot.slot
ro.boot.slot_suffix is the correct parameter.

Bug: 37663204
Test: boot sailfish
Change-Id: I72f94b3c611a2280d0732321dd8de88b0530a3cd
2017-09-20 10:14:44 -07:00
Josh Gao
1425641300 Merge changes I0ed00441,I12d46493,Ib484f701
am: 0a01830612

Change-Id: I8b4566f0daea2181227facea12d82ffd566889b5
2017-09-14 20:35:31 +00:00
Josh Gao
0a01830612 Merge changes I0ed00441,I12d46493,Ib484f701
* changes:
  Revert "adb: fix deadlock between transport_unref and usb_close."
  adb: add lock to remove_socket.
  adb: reformat comments.
2017-09-14 20:04:42 +00:00
Mark Salyzyn
6818f80dbb Merge changes from topic "b/63736262"
am: 1f666a6be9

Change-Id: I2586aac3d6fe8252ee6728de64fb37102accf0da
2017-09-13 22:45:52 +00:00
Josh Gao
33d14b8748 adb: partially revert b5e11415.
Revert the write_msg_lock part of commit b5e11415. A write which hangs
will hold onto the mutex, preventing the device kick from ever
happening, which also causes lots of other stuff to hang, due to Kick
being called with the transport lock taken.

Test: python test_devices.py
Change-Id: Ie7c958799c93cad287c32d6bbef30c07f40c2d51
2017-09-13 15:09:40 -07:00
Josh Gao
e48ecce671 Revert "adb: fix deadlock between transport_unref and usb_close."
This reverts commit 7e197ef833.

The mutex lock in transport_unref hides a race that seems otherwise
hard to fix. Specifically, there's no synchronization between acquiring
a transport and attaching it to an asocket*, leading to badness if the
transport is closed in between the two operations.

Fix the original problem the reverted patch addressed by manually
unlocking before calling unregister_usb_transport.

Bug: http://b/65419665
Test: python test_device.py
Change-Id: I0ed0044129b1671b2c5dd1b9fa2e70a9b4475dc5
2017-09-13 14:31:14 -07:00
Josh Gao
62c92f0c05 adb: add lock to remove_socket.
The comment that was previously here says that local_socket_list_lock
must be taken, but this function is exposed to external callers that
can't possibly take the lock.

Bug: http://b/65419665
Test: python test_device.py
Change-Id: I12d464933936b2a210a827ccf19ea201020d8d78
2017-09-13 14:05:39 -07:00
Josh Gao
55c8b34f14 adb: reformat comments.
Test: none
Change-Id: Ib484f701f66cdb57f303dbd6d5eb2e5a15abdc0e
2017-09-13 14:05:21 -07:00
Mark Salyzyn
277eca138b adb: reboot: last boot command default
For reboot [reboot_arg] requests via either reboot or adb reboot,
if reboot_arg is empty then report "shell" or "adb" respectively.

Test: boot_reason_test.sh shell_reboot adb_reboot
Bug: 63736262
Change-Id: Ie613d9e62db6a705885e4e7520aede27af3aa1b9
2017-09-12 12:24:02 -07:00
Bowgo Tsai
08a8c4209f Merge "Revert "adbd: lessen security constraints when the device is unlocked""
am: 9638729a9d

Change-Id: I25eab992b0a4c2f144454cd5865fad1a762cfc61
2017-08-31 08:27:33 +00:00
Treehugger Robot
9638729a9d Merge "Revert "adbd: lessen security constraints when the device is unlocked"" 2017-08-31 08:21:08 +00:00
Bowgo Tsai
0603ec4294 Revert "adbd: lessen security constraints when the device is unlocked"
This reverts commit f1d3dbc32f.

With the following changes to move /sbin/adbd to /system/bin/adbd,
we don't need this workaround anymore.

  https://android-review.googlesource.com/#/q/topic:move-adbd-to-system+(status:open+OR+status:merged)

Bug: 63313955
Bug: 63381692
Bug: 64822208
Test: 'adb root' works in VTS for a non-A/B device (userdebug GSI + user boot.img)

Change-Id: Ic1249d6abd7d6e6e7380a661df16d25447853a48
2017-08-31 14:30:51 +08:00
Bowgo Tsai
f390f04381 Merge "Move adbd from root to system"
am: 3d6f85167e

Change-Id: I3b89a7a8e98252319f850a225ef7ba2080e54879
2017-08-31 06:30:48 +00:00
Treehugger Robot
3d6f85167e Merge "Move adbd from root to system" 2017-08-31 06:22:16 +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
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
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
Bowgo Tsai
7b9a4d5bcd 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
Merged-In: I1b27910c06a4172ca718b3344736ec8e3429f477
(cherry picked from commit 93defc17f3)
2017-08-24 14:22:07 +08: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
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
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
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
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
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
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
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
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
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
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
Treehugger Robot
046160959c Merge "Indicate that a packet was truncated." 2017-06-27 22:50:48 +00:00
Dan Albert
9893f93950 Indicate that a packet was truncated.
Test: make checkbuild, check adb log
Bug: None
Change-Id: I0006ed284697f01966fdd79ca0b05dbc6d2eecf0
2017-06-27 13:26:14 -07:00
Josh Gao
cb39742d3a Merge "Revert "adb: turn on libusb by default."" am: b22067677e am: de931dab2d
am: 947a301852

Change-Id: Ideabacf8cd79adaf6fb828874ac636ed88707240
2017-06-26 22:17:29 +00:00
Treehugger Robot
b22067677e Merge "Revert "adb: turn on libusb by default."" 2017-06-26 21:33:34 +00:00
Josh Gao
969110ca4a 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
2017-06-26 13:17:58 -07:00
Elliott Hughes
b76034e755 Merge "Give a clear error message if we can't start the server." am: b6d3f28287 am: 1496863091
am: 07db226264

Change-Id: Ic2244ee02ca83ccdffcfbefac49797c2e4f7d459
2017-06-21 01:06:53 +00:00
Treehugger Robot
b6d3f28287 Merge "Give a clear error message if we can't start the server." 2017-06-21 00:48:30 +00:00
Elliott Hughes
6eadee8607 Give a clear error message if we can't start the server.
Bug: http://b/35218713
Test: adb kill-server ; export HOME=/ ; adb devices
Change-Id: I53cc30213be0eab84e42b09c7b501362d6e44b05
2017-06-20 14:21:41 -07:00
Josh Gao
24e8e0d0d8 Merge "adb: increase the shell command length limit." am: 9d2e688b9a am: 749d2a0ab5
am: 3df484eeab

Change-Id: I90d845f1c2b6aa767a7c5540b25619724f3b2331
2017-06-17 22:10:31 +00:00
Treehugger Robot
9d2e688b9a Merge "adb: increase the shell command length limit." 2017-06-17 21:57:12 +00:00
Josh Gao
a019f78141 adb: increase the shell command length limit.
Relax the shell command length limits when talking to an adbd with the
shell protocol.

shell is pretty much the only service that takes an arbitrarily long
string, so this is somewhat safe.

Bug: http://b/37716055
Test: `adb shell $(python -c 'print "echo " + "f" * (32*1024)') | wc` on L and master
Change-Id: I0737fd2244530ef8080f300cd3a3549a1ab93465
2017-06-16 18:01:11 -07:00
Josh Gao
7ff1e56f59 Merge "adb: fix deadlock between transport_unref and usb_close." am: 6f61a6d9c4 am: 2a8ce10cd8
am: 64523c01bd

Change-Id: I94128840430281a54c74cdfb2b35744b4730942f
2017-06-12 23:16:10 +00:00