Commit graph

2226 commits

Author SHA1 Message Date
Josh Gao
4c38a921c2 Merge changes I21eefab9,I0ac7d78a
* changes:
  adb: move usb_* to client/usb_*.
  adb: reorganize adbd USB handling code.
2017-01-25 21:52:45 +00:00
Josh Gao
fb9a7e5995 adb: check for and report inotify_init1 failure.
Bug: http://b/34396687
Test: mma
Change-Id: I55ea84db49017a6533ac54db5072e3e75ba30097
2017-01-20 15:26:00 -08:00
Josh Gao
456e1ad420 adb: move usb_* to client/usb_*.
Bug: http://b/31321337
Test: mma
Change-Id: I21eefab953737e87d211959616ac4f48926dd92c
2017-01-19 15:49:55 -08:00
Josh Gao
44c688ca19 adb: reorganize adbd USB handling code.
Break adbd's USB initialization code into its own static library to
allow it to be used by benchmark code that pretends to be adbd.

Bug: http://b/31289465
Test: adb shell works on bullhead
Change-Id: I0ac7d78a4f7aef59bd6d14fc5cf1ed870e1f3a9d
2017-01-19 13:19:45 -08:00
Josh Gao
cbe70cb0a8 debuggerd: advance our amazing bet.
Remove debuggerd in favor of a helper process that gets execed by
crashing processes.

Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I9906c69473989cbf7fe5ea6cccf9a9c563d75906
2017-01-17 13:57:57 -08:00
Elliott Hughes
83ab5c29c1 -e is really about TCP/IP devices, not emulators.
Despite the name.

Bug: N/A
Test: N/A
Change-Id: I099222137fabf68f961a6a2e5d11f2904ffd5a0d
2017-01-13 16:58:25 -08:00
Josh Gao
72d4c42cd5 Merge "adb: remove support for legacy f_adb interface." 2017-01-12 21:24:34 +00:00
Josh Gao
183b73e665 adb: remove support for legacy f_adb interface.
Everything should be using the functionfs interface instead by now.

Bug: http://b/34228376
Test: grepping for f_adb, android_adb in source tree
Test: m
Change-Id: I6bc41049c49a867499832588dac8ed108c636c11
2017-01-11 15:00:03 -08:00
Alex Deymo
705353ae27 Remove "_static" and "_host" suffix from libext4_utils.
Bug: 34220783
Change-Id: I967dbaa9c48ad1feed2369c3a40f745b86a350f8
2017-01-11 14:05:42 -08:00
Tao Bao
40e0ec918e adb: Fix the 'adb reboot sideload' for A/B devices.
We used to write the command file (/cache/recovery/command) to trigger
the sideload mode. A/B devices don't support that (may not have /cache
paritition). This CL switches to using libbootloader_message which
writes the command to BCB (bootloader control block) instead.

Test: "adb root && adb reboot sideload" reboots sailfish into recovery
      sideload mode.

Change-Id: I158fd7cbcfa9a5d0609f1f684a2d03675217628f
2017-01-05 18:01:01 -08:00
Treehugger Robot
94dd4b7410 Merge "adb: fix adb trace tag" 2016-12-17 00:07:41 +00:00
Josh Gao
a27666b823 adb: don't require adb keys to be named "*.adb_key".
Don't require the extension on explicit file paths passed on; only
check for it in monitored directories.

Bug: http://b/33638233
Test: ADB_TRACE=1 ADB_VENDOR_KEYS=$HOME/foo adb server nodaemon
Change-Id: I7387e0bbe0f2e16878bf22b05d5c6e8d0f9e5a92
2016-12-14 17:05:36 -08:00
Treehugger Robot
e69e9be7b6 Merge "adb: remove extraneous stat in sync_recv." 2016-12-14 21:11:23 +00:00
Daniel Friederich
b644134858 adb: fix adb trace tag
The ADB trace enum value collided with the 0 values used to mean all, hence it
was not possible to just trace the ADB tagged messages without also tracing everything else.

Change-Id: I15ff9c50c4ac01806c4841cf8213ce859faf130b
Test: Manually by setting ADB_TRACE and running adb, e.g. "ADB_TRACE=adb adb shell ls"
2016-12-14 12:41:43 -06:00
Josh Gao
52df920fd6 adb: add script to trace adbd.
Bug: http://b/31289465
Test: sh trace.sh
Change-Id: Id6e20e83742541aec6bfd9f4112adbdadc078f74
2016-12-13 14:31:17 -08:00
Josh Gao
f0f854bc76 adb: retry install_listener for a while.
install_listener can fail if we told a previous adb server to quit and
it hasn't finished doing so yet. Retry it for a few hundred
milliseconds to avoid this.

Bug: http://b/28618716
Test: nc -l 5037; adb server nodaemon
Change-Id: Ibbda8f2718b85a2b6a08985aa8d29aa2204a3ead
2016-12-12 18:20:57 -08:00
Josh Gao
aac1145a5b adb: remove extraneous stat in sync_recv.
We do a remote stat to get the file's size before pulling in sync_recv,
but all of the callers to sync_recv have already done a stat. Pass the
expected file size into sync_recv to remove its stat.

Bug: http://b/31289465
Test: python test_device.py
Change-Id: I7ca8ed11c6134e5954acac86626f880ade3ec696
2016-12-12 16:47:34 -08:00
Josh Gao
cfe72e290b adb: add tracing to transport.cpp.
Bug: http://b/31289465
Test: systrace
Change-Id: I41968f447b61ef1eea2b933a5fd8623605c4dea6
2016-12-12 12:28:45 -08:00
Josh Gao
1290fbf5eb adb: clang-format transport.cpp
Bug: http://b/31289465
Test: none
Change-Id: If99a9f1d4d6fa1d34b0ac3bbfc7f2e6bfc188ff2
2016-12-12 12:28:45 -08:00
Josh Gao
fd12aaa8c1 adb: add tracing to file_sync_service.cpp.
Bug: http://b/31289465
Test: systrace
Change-Id: I186675ca0310ace0e1d35561fa0b910417dcedd7
2016-12-12 12:28:45 -08:00
Bill Yi
a794775592 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD 2016-12-06 15:07:48 -08:00
Josh Gao
5a1e3fdaf8 Revert "Revert "adb: extend sync protocol's stat support.""
This reverts commit afa4b5d6eb.

Add functions to translate errno to and from the linux asm-generic
values, since mips has different values.

Bug: http://b/33058958
Test: python test_device.py with both old and new adbd
Change-Id: I1a122235f3e793ed10b3bf3ad293388015134150
2016-12-05 17:38:30 -08:00
Josh Gao
a3577e1ac5 Revert "Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp.""
This reverts commit 43c02b27cd.

Test: mma
Change-Id: I6b22ead8a4b964973ee2fdb8deba42bea74880cf
2016-12-05 17:38:30 -08:00
Josh Gao
bad5069cc0 Revert "adb: extend sync protocol's stat support."
am: afa4b5d6eb

Change-Id: I5fbf0e936685b320d322d4a8e1b1671f2d0da8cf
2016-12-05 21:23:44 +00:00
Josh Gao
3cad1843f8 Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp."
am: 43c02b27cd

Change-Id: I5a4a050fdbf05910edf2e55dfb8442e30e88464e
2016-12-05 21:23:38 +00:00
Josh Gao
afa4b5d6eb Revert "adb: extend sync protocol's stat support."
This reverts commit d6d5c38469.
2016-12-05 13:16:02 -08:00
Josh Gao
43c02b27cd Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp."
This reverts commit 4fba3d2638.
2016-12-05 13:15:55 -08:00
Josh Gao
d5286d376b adb: move adb_strerror to sysdeps/win32/errno.cpp.
am: 4fba3d2638

Change-Id: Ibdfa8ebbcfee5baf459f82fd13e1a0e8167c5053
2016-12-05 20:35:41 +00:00
Josh Gao
4733b631ed adb: extend sync protocol's stat support.
am: d6d5c38469

Change-Id: I26a1518bba4f65c0fdcc7c75d751badd9a3563d3
2016-12-05 20:35:36 +00:00
Josh Gao
97e228e903 Merge changes I9df4d6fa,I841123de
* changes:
  adb: move adb_strerror to sysdeps/win32/errno.cpp.
  adb: extend sync protocol's stat support.
2016-12-05 20:31:55 +00:00
Elliott Hughes
32ca0ab616 Merge "Remove unused adb_set_transport."
am: b898ce00fa

Change-Id: Ia428922f1a0241b8d7ec97517d360b02596a9781
2016-12-03 04:23:10 +00:00
Elliott Hughes
de80be39aa Remove unused adb_set_transport.
Bug: N/A
Test: builds
Change-Id: I0824d29c080c47e1002abf3520ebed8996bcbcc6
2016-12-02 12:53:09 -08:00
Josh Gao
4fba3d2638 adb: move adb_strerror to sysdeps/win32/errno.cpp.
Bug: none
Test: mma
Change-Id: I9df4d6faf9883a78f50ca6b2b7c35f095d06ae20
2016-11-30 13:23:21 -08:00
Josh Gao
d6d5c38469 adb: extend sync protocol's stat support.
Extend the file sync protocol to support calling regular stat (instead
of lstat), return error codes, and provide the entire stat struct.

Bug: http://b/33058958
Test: python test_device.py with both old and new adbd
Change-Id: I841123debc380f86194a19e91c97d85160112144
2016-11-30 13:23:21 -08:00
Josh Gao
b6e9e5ddde adb: be more permissive in test_push_error_reporting.
am: 79ce3fe7db

Change-Id: I1239b5af85edca9ae6fa1a38f755b5707bbc614b
2016-11-29 18:18:49 +00:00
Josh Gao
68fd28e334 adb: make sure that file mode macros match linux.
am: 05a3abfef3

Change-Id: I39a6938adc8b9b1da0185d36a1891f755bf2ca38
2016-11-29 18:18:44 +00:00
Josh Gao
79ce3fe7db adb: be more permissive in test_push_error_reporting.
Be agnostic to whether /system is writable when testing push error
reporting.

Test: python test_device.py
Change-Id: I1d03564fa35442c20e2c96a7f5b56d39868efc52
2016-11-21 18:39:21 -08:00
Josh Gao
05a3abfef3 adb: make sure that file mode macros match linux.
We use <sys/stat.h> mode macros on the host to parse modes sent over
from the device, so they had better match. Add static_asserts to ensure
this.

(Also, fix the cases where they don't.)

Test: mma -j48, compiled the static_asserts on darwin manually
Change-Id: I883e4e6c7489ea64d3c02d26790ac8293366d989
2016-11-21 18:39:21 -08:00
Josh Gao
c2102a7b8f Merge "adb: fix progress percentage when pulling symlinks."
am: 453db013b0

Change-Id: I3789390531b46c7dc5ac6796e62e6e43bba3bcca
2016-11-18 02:17:56 +00:00
Treehugger Robot
453db013b0 Merge "adb: fix progress percentage when pulling symlinks." 2016-11-18 02:13:19 +00:00
Josh Gao
da1f279509 adb: fix progress percentage when pulling symlinks.
The adb protocol currently only supports lstat with no way of finding
the target of a symlink, so pulling a symlink that points to a file
looks like pulling a file with length equal to the length of path to
the symlink's target. Pulling a file that's sufficiently large can
overflow the int used to calculate percentage, and result in a bogus
completion percentage being displayed.

Bug: http://b/29277448
Test: adb pull /dev/block/platform/soc.0/f9824900.sdhci/by-name/system
Change-Id: I42d180550ac2aa9e4705676ccbb20f5db789fb8d
2016-11-17 16:17:07 -08:00
Elliott Hughes
8e5fb5a0e7 Merge "Remove dead code."
am: 3bde05d928

Change-Id: Ib748fef3e54687c2da1818a7cd738f31e30b79ac
2016-11-17 20:39:22 +00:00
Treehugger Robot
3bde05d928 Merge "Remove dead code." 2016-11-17 20:29:10 +00:00
Elliott Hughes
284f07bd9d Remove dead code.
At this point, we can't write to oom_score_adj anyway.

Bug: https://code.google.com/p/android/issues/detail?id=227721
Test: boots, adb shell still works
Change-Id: I07e6ad32765f6582f316973547a3a3d552808287
2016-11-17 10:32:16 -08:00
Josh Gao
27bbe8bfb2 Merge "adb: add sysdeps/chrono.h for chrono literals on Win32."
am: e631e470e0

Change-Id: Ie62e995d9790bf7539f3f9fca05de7b4b359dc7c
2016-11-16 22:29:30 +00:00
Josh Gao
4602adbcd3 adb: add sysdeps/chrono.h for chrono literals on Win32.
Bug: http://b/32878766
Test: mma
Change-Id: Iaa89d4eadf07e63d6d7205057435a6c7fb5d4ec5
2016-11-16 12:14:59 -08:00
Elliott Hughes
2278b50f24 Merge "Switch adb over to <chrono>."
am: 59826ddee5

Change-Id: I673ce3c9f4a104df3197ec7120a126155e18918e
2016-11-16 20:14:20 +00:00
Elliott Hughes
dbe91eee26 Switch adb over to <chrono>.
Clearer code, and lets us lose some more portability cruft.

Bug: http://b/32878766
Test: manual
Change-Id: Ie44928bbf8d68a74127aaf76e7e0060e25fa2cc8
2016-11-16 09:12:12 -08:00
Jin Qian
c6fbcd7579 Merge "Set file capabilities after writing file data"
am: dd4e5ae943

Change-Id: I135c6ebf4fc9b11a7ed9798be1ce0a88862386a5
2016-11-03 17:29:31 +00:00
Jin Qian
d0515e7165 Set file capabilities after writing file data
File capabilities will be cleared if we set them before writing file data.

Bug: 32543395

Change-Id: I88cc0a0ec23cd6fc6dbe86c93a76914809d7e5f9
2016-11-02 16:37:11 -07:00