Commit graph

1795 commits

Author SHA1 Message Date
Yabin Cui
1a3ce9b3a6 Merge "adb: add reconnect command." am: 643bc36
am: 1dd696a

* commit '1dd696a52687106d9926374d18895a911cc6fd28':
  adb: add reconnect command.

Change-Id: Ibfdfe1675a8d3627d4fb8eef3592b9b836dc4d19
2016-04-16 02:00:33 +00:00
Yabin Cui
643bc369ef Merge "adb: add reconnect command." 2016-04-16 01:50:54 +00:00
Treehugger Robot
1c8bf422d9 Merge changes Ibc8038b1,I1876ecd7,I57d70f8b am: 3e0eaa4
am: c35de74

* commit 'c35de74b2b9d017a74ca3da99f8c23aad033f0f5':
  adb: after `adb root`, wait for the device in any state.
  adb: add support for 'wait-for-any'.
  adb: make 'wait-for-{recovery,sideload,bootloader} work.

Change-Id: I153b8e88cea2b2e6d5916145bf1e1145c4721b14
2016-04-13 20:38:30 +00:00
Treehugger Robot
3e0eaa4103 Merge changes Ibc8038b1,I1876ecd7,I57d70f8b
* changes:
  adb: after `adb root`, wait for the device in any state.
  adb: add support for 'wait-for-any'.
  adb: make 'wait-for-{recovery,sideload,bootloader} work.
2016-04-13 20:25:53 +00:00
Josh Gao
48a348183f adb: after adb root, wait for the device in any state.
Otherwise, `adb root` while the device is in recovery will hang.

Bug: http://b/28168212
Change-Id: Ibc8038b1745139fb505e466c74c605b9df474c8c
2016-04-13 12:28:04 -07:00
Josh Gao
86441c31fe adb: add support for 'wait-for-any'.
Allow waiting for a device in any state.

Bug: http://b/28168212
Change-Id: I1876ecd70089ca88f2da5de4182e13724ec50501
2016-04-13 12:28:04 -07:00
Josh Gao
08881e72f4 adb: make 'wait-for-{recovery,sideload,bootloader} work.
The help for wait-for-* documents this as working, but we only had a
special case for 'wait-for-device'. Make the others work as well.

Bug: http://b/28170823
Change-Id: I57d70f8b9a383947c4f761919bfbd8515a013520
2016-04-13 12:28:04 -07:00
Felipe Leme
1e0161e934 Merge "Implements \'adb bugreport <ZIP_FILE>\'." into nyc-dev
am: e04c9f3

* commit 'e04c9f34364d76ad0f3580f566ea710285426c83':
  Implements 'adb bugreport <ZIP_FILE>'.

Change-Id: I7c5112d8e804394c705bee3e4cae227f5da68702
2016-04-13 18:39:06 +00:00
Felipe Leme
44a42677cf Implements 'adb bugreport <ZIP_FILE>'.
Dumpstate now supports zipped bugreport, whose output is more complete
than the flat-file bugreports provided prior to N. As such, adb now has
a 'adb bugreport <ZIP_FILE>' name whose implementation:

- Calls the new bugreportz binary.
- Parses its output, which in case of success is the path of the .zip
  file.
- Pulls the device file and renames it according to the command-line
  argument.

BUG: 27653204

Change-Id: I7169fe157c77bbef1684d0cb4e43095d95ddf2b8
2016-04-13 09:21:23 -07:00
Elliott Hughes
9c4a0e0216 Merge changes from topic \'boringssl_conversion\' am: 52eb93c
am: 0781351

* commit '07813516502d12cfeabef94838e916c0cf4f3b46':
  Switch fs_mgr and adb to libcrypto_utils.
  Add libcrypto_utils.

Change-Id: Ib50abd66d546a2b2c7a1249043e1b39c2147c674
2016-04-12 23:22:11 +00:00
Mattias Nissler
097b6bbc76 Switch fs_mgr and adb to libcrypto_utils.
Update code and dependencies to use BoringSSL + libcrypto_utils
instead of mincrypt.

Change-Id: Ic75164bd50c84b81b6310e27a67d4b3c174984f9
2016-04-12 23:04:11 +00:00
Yabin Cui
1f4ec19e49 adb: add reconnect command.
Add reconnect command for debugging. `reconnect` kicks a transport
from the host side, `reconnect device` kicks a transport from
the device side. They can be used to produce transport errors.

Bug: 25935458

Change-Id: I47daa338796b561941e7aba44a51a6dd117d1e98
2016-04-05 15:21:36 -07:00
Dan Austin
7b2125d2b1 Merge "Address const issues in preparation for libcxx rebase." am: b2cb35e
am: 4e39764

* commit '4e3976417b4e43c2a3969fb3305d9f069ec8c8f8':
  Address const issues in preparation for libcxx rebase.

Change-Id: I7b25949ccdae45398f47c43f79fa532d66d4d3a2
2016-03-30 19:15:39 +00:00
Dan Austin
0bab7c3dbd Merge "Address const issue in preparation for libcxx rebase." am: a2a13e3
am: 61e5a66

* commit '61e5a6625dfdb586abb9f83b20bc1d727a783225':
  Address const issue in preparation for libcxx rebase.

Change-Id: I883b8210df7c8ddd1f82914ba448af0175f53437
2016-03-30 19:15:38 +00:00
Dan Austin
b2cb35ef96 Merge "Address const issues in preparation for libcxx rebase." 2016-03-30 17:40:15 +00:00
Dan Austin
b4cff495a1 Address const issues in preparation for libcxx rebase.
Change-Id: I4eccc1b5a70da9dd325e1a7e10ab0a3fe588c03f
2016-03-29 17:17:51 +00:00
Dan Austin
80fd4549e3 Address const issue in preparation for libcxx rebase.
Change-Id: I80c3349ee93d2b3f16c6fadc7f34b2bf4f2cc0d3
2016-03-28 23:28:48 +00:00
Elliott Hughes
b80557a608 Merge "Fix buffer overrun in adb wait-for-device."
am: 1f13c1a208

* commit '1f13c1a208394b74a8c60e677546a8c8ed697091':
  Fix buffer overrun in adb wait-for-device.
2016-03-11 17:01:53 +00:00
Elliott Hughes
1ef5bf839e Fix buffer overrun in adb wait-for-device.
Bug: http://b/27444063

(cherry picked from commit 34e560b9a1)

Change-Id: Ic71cb2070f509d76fb4208dbab6711c5dd5e1f62
2016-03-11 08:55:01 -08:00
Elliott Hughes
1f13c1a208 Merge "Fix buffer overrun in adb wait-for-device." 2016-03-11 16:53:26 +00:00
Elliott Hughes
34e560b9a1 Fix buffer overrun in adb wait-for-device.
Bug: http://b/27444063
Change-Id: I72339d7215aae28069484b9796d71fe0c53dff96
2016-03-10 17:59:17 -08:00
Prathmesh Prabhu
d387acc9b8 emulator: Use distinct serial names for simultaneous qemu pipes.
ADB local transport for the emulator based on qemu pipes uses a socket
transport. Before this CL, multiple connection requests accepted by the
qemu pipe device would result in ADB transport with the same serial.
The register function would fail as a result, and all subsequent
connections would fail.

Test:
while true; do adb kill-server; adb devices; done
Doesn't fail for > 10 minutes.

This CL replaces an earlier CL
(I0fdcf2694516151c5f8f8e1580648b940679c981) that was unsafe for real
devices.

BUG=27441661

Change-Id: I7d801b175f3bee10fc7e0ab1b12d5623984371b9
2016-03-10 09:26:49 -08:00
Prathmesh Prabhu
f7b6d9cea9 Merge "emulator: Use distinct serial names for simultaneous qemu pipes." into nyc-dev
am: 01d76eb1ec

* commit '01d76eb1ecb943db042eb6618087c0e22588e6b3':
  emulator: Use distinct serial names for simultaneous qemu pipes.
2016-03-10 17:16:46 +00:00
Prathmesh Prabhu
01d76eb1ec Merge "emulator: Use distinct serial names for simultaneous qemu pipes." into nyc-dev 2016-03-10 17:13:26 +00:00
Prathmesh Prabhu
251d46e68a emulator: Use distinct serial names for simultaneous qemu pipes.
ADB local transport for the emulator based on qemu pipes uses a socket
transport. Before this CL, multiple connection requests accepted by the
qemu pipe device would result in ADB transport with the same serial.
The register function would fail as a result, and all subsequent
connections would fail.

Test:
while true; do adb kill-server; adb devices; done
Doesn't fail for > 10 minutes.

This CL replaces an earlier CL
(I0fdcf2694516151c5f8f8e1580648b940679c981) that was unsafe for real
devices.

BUG=27441661

Change-Id: I7d801b175f3bee10fc7e0ab1b12d5623984371b9
2016-03-09 13:51:30 -08:00
Josh Gao
8238dd8499 adbd: fix spurious close of uninitialized fd.
forkpty only returns an fd on the master side; trying to keep track of
it on both sides is incorrect.

Bug: http://b/27504427
Change-Id: Ia4a454d8490c77738f9c3350a4236b3d99c8758b
(cherry picked from commit fcb063ce37)
2016-03-04 19:15:11 -08:00
Josh Gao
5767d0dd5a adb: wait for restore to complete before returning.
If we return before waiting for the other side to finish, it'll get sent
SIGHUP.

Bug: http://b/27414382
Change-Id: I93514d2242ed0d7aa93a6ec6836270dc0783506d
(cherry picked from commit d26abed750)
2016-03-04 19:15:11 -08:00
Josh Gao
06c73ae942 adb: wait for adbd to die and respawn in root/unroot.
Bug: http://b/19749057
Change-Id: I57dbc113803b6fd3016c1801410be0f4023245d9
(cherry picked from commit d26212207d)
2016-03-04 19:15:11 -08:00
Josh Gao
a9eb38d6a5 adb: make ScopedFd universally accessible and useful.
Change-Id: I707ffbd10958e7449b4c95dff48638480c746939
(cherry picked from commit f0d3b4fc11)
2016-03-04 19:15:11 -08:00
Josh Gao
3bb90a6acd Merge changes I93514d22,I57dbc113,I707ffbd1 am: 1cd680ce75
am: 6aafa03c60

* commit '6aafa03c606d06a5cb6549c1cc382a2038552256':
  adb: wait for restore to complete before returning.
  adb: wait for adbd to die and respawn in root/unroot.
  adb: make ScopedFd universally accessible and useful.
2016-03-05 03:10:45 +00:00
Josh Gao
f5b960538f Merge "adbd: fix spurious close of uninitialized fd." am: 3c608c7425
am: 97b9935fba

* commit '97b9935fba43cfa892ef4ae2792a68c276b6f128':
  adbd: fix spurious close of uninitialized fd.
2016-03-05 03:10:35 +00:00
Josh Gao
1cd680ce75 Merge changes I93514d22,I57dbc113,I707ffbd1
* changes:
  adb: wait for restore to complete before returning.
  adb: wait for adbd to die and respawn in root/unroot.
  adb: make ScopedFd universally accessible and useful.
2016-03-05 03:04:47 +00:00
Josh Gao
fcb063ce37 adbd: fix spurious close of uninitialized fd.
forkpty only returns an fd on the master side; trying to keep track of
it on both sides is incorrect.

Bug: http://b/27504427
Change-Id: Ia4a454d8490c77738f9c3350a4236b3d99c8758b
2016-03-04 18:08:18 -08:00
Josh Gao
d26abed750 adb: wait for restore to complete before returning.
If we return before waiting for the other side to finish, it'll get sent
SIGHUP.

Bug: http://b/27414382
Change-Id: I93514d2242ed0d7aa93a6ec6836270dc0783506d
2016-03-04 15:51:03 -08:00
Josh Gao
d26212207d adb: wait for adbd to die and respawn in root/unroot.
Bug: http://b/19749057
Change-Id: I57dbc113803b6fd3016c1801410be0f4023245d9
2016-03-04 15:48:39 -08:00
Josh Gao
f0d3b4fc11 adb: make ScopedFd universally accessible and useful.
Change-Id: I707ffbd10958e7449b4c95dff48638480c746939
2016-03-04 15:15:56 -08:00
Josh Gao
a996c2963a adb: clean up quotes in test_device.py.
Change-Id: I7fe7724578ad89a004665d1bbff0d5c02c34c35e
(cherry picked from commit 255c5c8077)
2016-03-03 15:46:51 -08:00
Josh Gao
379612b128 adb: mkdir the correct directory name when pulling.
The directory name should be based off of the local path, not the remote
path.

Change-Id: I75b089b8734e9dbf8e466b1e00ea18549fd101bb
(cherry picked from commit 89ec3a8d0f)
2016-03-03 15:46:51 -08:00
Josh Gao
48bc0d7853 adb: cleanup file skipping logic.
Bug: http://b/26355212
Change-Id: Iafa250ce6c5ea8da9f5f00125165e5b67ef1013f
(cherry picked from commit a31ea55c55)
2016-03-03 15:46:51 -08:00
Josh Gao
74e0fe73c0 adb: symlinks to dirs count as dirs for pull destination.
This matches scp's behavior when pulling a directory that collides
with a symlink to a directory.

Bug: http://b/27362811
Change-Id: I0936d1ad48f13e24cd382e8e8400cc752bac3b66
(cherry picked from commit 1e611a33d5)
2016-03-03 15:46:50 -08:00
David Pursell
802c54ebb7 adb: relax serial matching rules.
Currently targeting a device by serial requires matching the serial
number exactly. This CL relaxes the matching rules for local transports
to ignore protocol prefixes and make the port optional:
  [tcp:|udp:]<hostname>[:port]

The purpose of this is to allow a user to set ANDROID_SERIAL to
something like "tcp:100.100.100.100" and have it work for both fastboot
and adb (assuming the device comes up at 100.100.100.100 in both
modes).

This CL also adds some unit tests for the modified functions to make
sure they work as expected.

Bug: 27340240
Change-Id: I006e0c70c84331ab44d05d0a0f462d06592eb879
(cherry picked from commit 3f902aad5b)
2016-03-03 15:46:50 -08:00
Josh Gao
f22bc60fc9 adb: report progress for small files.
Bug: http://b/27407725
Change-Id: I7515144402a487fb3d4d403e2f5f82423c1b5ed6
(cherry picked from commit 9fd2f77dcc)
2016-03-03 15:46:50 -08:00
Ying Wang
f48503b4a0 Also archive adb.exe/fastboot.exe when building win_sdk.
On linux we archive both Linux and Windows binaries.

Bug: 27315911
Change-Id: I17d25cd1ea611a9c917f1e78b47f21a8959eea20
(cherry picked from commit 71edfc8b9a)
2016-03-03 15:46:50 -08:00
Josh Gao
a63b17f76c adb: fix directory creation logic.
Previously, for `adb pull $remote $local`, we would do the equivalent of
mkdir -p on `dirname $local`. This patch changes the behavior to only
creating directories that are being pulled, like scp.

Bug: http://b/27362811
Change-Id: I79f975ee9f2d9bc9e8be6a7c4f2de6d7ae2d2d23
(cherry picked from commit 71728ca300)
2016-03-03 15:46:50 -08:00
Josh Gao
d382d2bb51 adb: fix mistaken use of PLOG.
Change-Id: I60bfa3d8cf1572a877d6f0c9369d8f72f10e5aef
(cherry picked from commit 443a52c298)
2016-03-03 15:46:50 -08:00
Josh Gao
1f6ff07516 Merge changes I7fe77245,I75b089b8,Iafa250ce am: afa76a3028
am: 55592371dc

* commit '55592371dca3ccb25d516635b41bab73ed8b6059':
  adb: clean up quotes in test_device.py.
  adb: mkdir the correct directory name when pulling.
  adb: cleanup file skipping logic.
2016-03-03 23:45:58 +00:00
David Pursell
a76e5f035e adb: use TCP keepalive.
Currently adb only realizes a TCP transport has gone away when it tries
to send a packet, which caused problems in particular for `adb reboot`
since no packets are sent, leading to the client hanging until Ctrl+C.

This CL turns on TCP keepalive packets to send 1 packet every second,
allowing up to 10 failures before disconnecting. Using built-in TCP
functionality turns out to be much cleaner in this case than trying to
implement our own keepalive packets at the application layer, and
should be more lightweight since it's all done in the TCP stack.

Bug: http://b/23093474

Change-Id: Ifb41cbb85b9752a9f394e1eed3c6ac4da47a4e4d
(cherry picked from commit bfd9503d1d)
2016-03-03 15:42:11 -08:00
Josh Gao
afa76a3028 Merge changes I7fe77245,I75b089b8,Iafa250ce
* changes:
  adb: clean up quotes in test_device.py.
  adb: mkdir the correct directory name when pulling.
  adb: cleanup file skipping logic.
2016-03-03 23:39:05 +00:00
Josh Gao
255c5c8077 adb: clean up quotes in test_device.py.
Change-Id: I7fe7724578ad89a004665d1bbff0d5c02c34c35e
2016-03-03 14:53:52 -08:00
Josh Gao
89ec3a8d0f adb: mkdir the correct directory name when pulling.
The directory name should be based off of the local path, not the remote
path.

Change-Id: I75b089b8734e9dbf8e466b1e00ea18549fd101bb
2016-03-03 14:53:06 -08:00