Commit graph

2210 commits

Author SHA1 Message Date
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
Josh Gao
1d51d6d6aa Merge "adb: add adb reconnect offline to reconnect offline devices."
am: 0945380e36

Change-Id: I832f5c97f455b2b38b4bcd734759cb9561ec9b31
2016-10-31 21:33:19 +00:00
Josh Gao
0945380e36 Merge "adb: add adb reconnect offline to reconnect offline devices." 2016-10-31 21:26:23 +00:00
Josh Gao
22d2b3e1c2 adb: add adb reconnect offline to reconnect offline devices.
Add a command to reconnect offline/unauthorized devices, mainly for use
with the inotify-monitoring of vendor key directories added by 2e671202.

Bug: http://b/29273531
Test: manually tested with a sailfish + copying vendor keys
Change-Id: If34cccee4ae553ada65d128b57d03cba8c0d7c46
2016-10-27 17:13:23 -07:00
Elliott Hughes
a4f497e0a2 Merge "Make "adb logcat" pass $ANDROID_LOG_TAGS through again."
am: b838ff65d9

Change-Id: I29acb11ca837c1824e4530c1e6315f04c7a25648
2016-10-27 01:10:07 +00:00
Elliott Hughes
90390302d5 Make "adb logcat" pass $ANDROID_LOG_TAGS through again.
But not for Windows, because even dealing with environment variables is
too hard there (and no Windows user has complained yet).

Bug: http://b/30184452
Test: manual
Change-Id: I2d60049ed0049a9532414a7cdecbd0687e06aba7
2016-10-26 15:12:14 -07:00
Elliott Hughes
66321bc889 Merge "Improve "adb install" diagnostics."
am: a16ae8717c

Change-Id: Ia3a8b9cfce4d5e939a8a894e959731874d1f2fd0
2016-10-26 18:37:34 +00:00
Treehugger Robot
a16ae8717c Merge "Improve "adb install" diagnostics." 2016-10-26 18:25:59 +00:00
Elliott Hughes
02ee1725ae Merge "Make "adb bugreport"'s .zip check case-insensitive."
am: da6fe65000

Change-Id: I34d95b38bec230729b3707c698b347c9a5908831
2016-10-26 15:39:50 +00:00
Elliott Hughes
7acce1b0ab Make "adb bugreport"'s .zip check case-insensitive.
Bug: TODO
Test: manual
Change-Id: I0ece7d8dcb708e3755477f7df5ff03807fd227f2
2016-10-25 17:24:54 -07:00
Elliott Hughes
7288478443 Improve "adb install" diagnostics.
Bug: http://b/32094640
Test: manual testing
Change-Id: I661936eabd3bdd8aa7ee8cc0e398a7cc7d4ddbbb
2016-10-25 17:23:40 -07:00
Elliott Hughes
e060cdadc8 Merge "Allow multiple tcp adb connection to same device."
am: 4818194a25

Change-Id: Id2b6bc99479e94cd94154ca194985f65df7e2afa
2016-10-24 23:36:44 +00:00
Elliott Hughes
4818194a25 Merge "Allow multiple tcp adb connection to same device." 2016-10-24 23:31:14 +00:00
Josh Gao
8baf1198ee adb: fix test_sighup.
am: 470622f064

Change-Id: I342cbd04804e3d8d92d04ab088c6980d67bbc8e8
2016-10-24 21:18:58 +00:00
Josh Gao
a06580956e adb: fix race condition in test_non_interactive_sigint.
am: e76b9f3dde

Change-Id: Ib2b6c1118cb48c337c12efbd223c87fee76837f2
2016-10-24 21:18:51 +00:00
Josh Gao
63660add3f Merge changes I34ba5757,Ie65a762a
* changes:
  adb: fix test_sighup.
  adb: fix race condition in test_non_interactive_sigint.
2016-10-24 21:13:18 +00:00
Josh Gao
470622f064 adb: fix test_sighup.
Bug: http://b/32336914
Test: python test_device.py
Change-Id: I34ba5757b5e650d79327dc6779064acd850ce28e
2016-10-24 13:34:20 -07:00