Commit graph

1958 commits

Author SHA1 Message Date
Josh Gao
6e106990cf adb: add implementations of mutex, recursive_mutex.
Our version of mingw doesn't support std::mutex or
std::recursive_mutex, so implement our own using the Windows primitives.

Bug: http://b/28347842
Change-Id: I4e1d56a89bc5fcb5f859bf5014343697a4a85b77
(cherry picked from commit 903b749f78)
2016-05-18 17:20:30 -07:00
Josh Gao
a41a0c2acc Merge "adb: use asocket\'s close function when closing." am: 684d543922
am: 43c058e51a

* commit '43c058e51a652874cfdf0c687ba1dee18f13f993':
  adb: use asocket's close function when closing.

Change-Id: I0681ff8c31c2f221e246a86857fbff779d2b7dcf
2016-05-19 00:16:11 +00:00
Treehugger Robot
684d543922 Merge "adb: use asocket's close function when closing." 2016-05-19 00:11:03 +00:00
Chih-Hung Hsieh
dccd3a3698 Merge "Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace." am: dab7d9de03
am: fa7569c921

* commit 'fa7569c921b9ca0db894287ea826cbd3b041d880':
  Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.

Change-Id: I63223e36f3627d312051c86d54919b6cef33766c
2016-05-19 00:05:39 +00:00
Treehugger Robot
dab7d9de03 Merge "Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace." 2016-05-18 23:54:40 +00:00
Josh Gao
ebb08fb9a6 Merge changes I5e56f17f,Ie3748b6c,I4e1d56a8 am: cea14958d2
am: 71c062f40a

* commit '71c062f40ac9ac5175f55bce03ce0cb8eb540710':
  adb: switch the socket list mutex to a recursive_mutex.
  adb: clang-format sockets.cpp.
  adb: add implementations of mutex, recursive_mutex.

Change-Id: Icd8a74f1052f7b4c4616ddf23b65c7208195202c
2016-05-18 23:22:47 +00:00
Chih-Hung Hsieh
67867dbd79 Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.
Bug: 28705665
Change-Id: I469b2a882f6d1f399bfc22c75a26da245991fc33
2016-05-18 15:53:15 -07:00
Josh Gao
53eb31d87c adb: use asocket's close function when closing.
close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.

Bug: http://b/28347842
Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e
2016-05-18 14:21:53 -07:00
Josh Gao
9b587dec6d adb: switch the socket list mutex to a recursive_mutex.
sockets.cpp was branching on whether a socket close function was
local_socket_close in order to avoid a potential deadlock if the socket
list lock was held while closing a peer socket.

Bug: http://b/28347842
Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3
2016-05-18 14:21:53 -07:00
Josh Gao
52bd8526aa adb: clang-format sockets.cpp.
Bug: http://b/28347842
Change-Id: Ie3748b6c803d4e8056e9d7abd065a8b99d945a5b
2016-05-18 14:21:53 -07:00
Josh Gao
903b749f78 adb: add implementations of mutex, recursive_mutex.
Our version of mingw doesn't support std::mutex or
std::recursive_mutex, so implement our own using the Windows primitives.

Bug: http://b/28347842
Change-Id: I4e1d56a89bc5fcb5f859bf5014343697a4a85b77
2016-05-18 14:21:53 -07:00
Josh Gao
666d9aa507 Merge "adb: replace failing exits in adbd with abort()." am: eb62619ff9
am: 4e1149bb15

* commit '4e1149bb152829a016873bbc7795646b5ff5f384':
  adb: replace failing exits in adbd with abort().

Change-Id: I78b30130181d09a7755a48c6b769e33def622f7b
2016-05-17 23:06:17 +00:00
Josh Gao
1209092769 Merge "adb: add track-jdwp and track-devices commands." am: f8f40a1e2e
am: 32045567be

* commit '32045567be1f5af449dfa16173f16b70ae34e85b':
  adb: add track-jdwp and track-devices commands.

Change-Id: I60e9899b403fa68e3037aed3a4bce498c66c6c7d
2016-05-17 23:06:15 +00:00
Yabin Cui
01401823fb adb: check return value of register_socket_transport.
Change-Id: I45e30861cf292323e3264a815e4ffd23d6610c52
2016-05-17 15:15:43 -07:00
Josh Gao
8781256b19 Merge "adb/base: allow use of unique_fd inside adb." am: 210fdc2742
am: 881b440b7a

* commit '881b440b7a228e065d4b42ec71add07fbcb336c4':
  adb/base: allow use of unique_fd inside adb.

Change-Id: Ib1c437bcc6462235b8a753fb8cdedb9ff7261e9c
2016-05-16 22:02:55 +00:00
Josh Gao
4abdeee073 adb: replace failing exits in adbd with abort().
This makes it possible to get a core dump from adbd when it decides to
exit.

Bug: http://b/28347842
Change-Id: I4cfe5f273f62b2c32e61232d3c39881ecdd6b582
2016-05-14 18:52:46 -07:00
Josh Gao
b463baf610 adb: add track-jdwp and track-devices commands.
Expose these to the command line client to make it easier to poke
around.

Bug: http://b/28347842
Change-Id: Ia939b3a41eb8201365d50cd2996b83d884e42b64
2016-05-14 18:35:44 -07:00
Josh Gao
13ea01db45 adb/base: allow use of unique_fd inside adb.
adb implements its own file descriptor emulation layer on Windows,
which requires the use of adb_close instead of close throughout the
codebase. Add a template argument to unique_fd that allows for this.

Bug: http://b/28347842
Change-Id: I6397261f4973d49f2f8e04257bf67b348585bb63
2016-05-14 18:25:51 -07:00
David Pursell
1e57ab6f7b Merge "adb: support forwarding TCP port 0." am: cb90562bcf
am: 5aaffac37e

* commit '5aaffac37e2b2b32e645c0c03c96a88a3133b3ae':
  adb: support forwarding TCP port 0.

Change-Id: I2e7bd29de76a87b80e71ce00ed2da4666f3cbb56
2016-05-13 15:21:04 +00:00
David Pursell
eaae97e127 adb: support forwarding TCP port 0.
This CL adds support to forward or reverse TCP port 0 to allow the
system to automatically select an open port. The resolved port number
will be printed to stdout:
  $ adb forward tcp:0 tcp:8000
  12345
  $ adb reverse tcp:0 tcp:9000
  23456
This allows testing to be more robust by not hardcoding TCP ports which
may already be in use.

Forwarding port 0 is a host-only change and will work with any device,
but reversing port 0 requires the device to be updated with a new adbd
binary.

This CL also does a little bit of cleanup such as moving the alistener
class out of adb.h, and adds some error checking and additional tests.

Bug: 28051746
Test: python -m unittest discover
Test: adb_test
Test: `adb forward` and `adb reverse` with tcp:0
Change-Id: Icaa87346685b403ab5da7f0e6aa186aa091da572
2016-05-09 16:55:10 -07:00
Josh Gao
2928f7df70 Merge "adb: search for a maximum of 16 emulators." into nyc-dev
am: 72e47300fb

* commit '72e47300fb2d7842509c492fcb8ee363d43ef446':
  adb: search for a maximum of 16 emulators.

Change-Id: I51d01d4d1d8985c37c6cf3c4dbaa19eba49ae306
2016-05-06 21:32:31 +00:00
Josh Gao
72e47300fb Merge "adb: search for a maximum of 16 emulators." into nyc-dev 2016-05-06 21:23:28 +00:00
Josh Gao
9fe742684c adb: search for a maximum of 16 emulators.
Android Wear has unfortunately been using port 5601 for years, which
falls into the range of ports we were previously polling for Android
emulators. Reduce the maximum number of emulators we can support so
that 5601 no longer falls within our range.

Bug: http://b/26468076
Change-Id: I931809cfa412122f4781eebe0164facab12c95f0
2016-05-06 11:27:19 -07:00
Felipe Leme
6993211d38 Merge "Display warning about bugreport delay." into nyc-dev
am: f99193b7aa

* commit 'f99193b7aa8eedb0f5be448c6df6d2688c1bfb2e':
  Display warning about bugreport delay.

Change-Id: I19de3a7c8e98127322a4f8454d87e4be39c2d071
2016-05-05 03:05:22 +00:00
Felipe Leme
42e45c7068 Display warning about bugreport delay.
BUG: 28569299
Change-Id: Ide6109fd24737cbaf6296ef7326127e85d6420cb
2016-05-04 16:20:25 -07:00
Felipe Leme
d4611a9680 Automatically add a .zip to adb bugreport file when missing.
am: 644a36c209

* commit '644a36c20942029ece43ea9fbeb6163d4b706c56':
  Automatically add a .zip to adb bugreport file when missing.

Change-Id: I081fbac07cba3c7e3cbfc263ed71ee4832224d9b
2016-05-03 21:34:13 +00:00
Felipe Leme
644a36c209 Automatically add a .zip to adb bugreport file when missing.
BUG: 27653204
Change-Id: Ib322f1f9eeedd8e78c9a51a845a20c462442a0fe
2016-05-03 10:21:22 -07:00
Chih-hung Hsieh
fb44ca5178 Merge "Fix google-explicit-constructor warnings." am: 7bdd6a8b5a
am: 427d8d840f

* commit '427d8d840f6ec5ce5767b2ee521e4ac5b7ebd619':
  Fix google-explicit-constructor warnings.

Change-Id: I26dc45aca83f991aa7993f6d4233e0439dd44a22
2016-04-30 05:16:35 +00:00
Chih-Hung Hsieh
1c563d96f0 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
2016-04-29 15:44:04 -07:00
Yabin Cui
69e97e4bee adb: close ep0 on disconnection.
adbd on device kicks the usb connection when usb IO fails. But to notify
adb on host to reconnect it, adbd needs to close ep0 to reset the usb
connection. Otherwise, adb on host cann't connect the device unless the
usb cable is reconnected or adb host server is restarted.

This can be tested by using `adb reconnect device` command.

Bug: 25935458

Change-Id: I80979d6029e60b9cfd218f7b9b5201810238ec07
2016-04-28 16:01:10 -07:00
Yabin Cui
9b53e4c42c adb: fix adb usb operations on device.
Problem: For devices using /dev/usb-ffs/adb, Run
`while true; do adb reconnect device; sleep 1; done`. And the
device soon becomes offline. The adbd log shows that calling
adb_read(h->bulk_out) in usb_ffs_read() gets EOVERFLOW error.

Reason: When kicking a transport using usb-ffs, /dev/usb-ffs/adb/ep0
is not closed, and the device will not notify a usb connection reset
to host. So the host will continue to send unfinished packets even
if a new transport is started on device. The unfinished packets may
not have the same size as what is expected on device, so adbd on
device gets EOVERFLOW error. At the worst case, adbd has to create new
transports for each unfinished packet.

Fixes:
The direct fix is to make the usb connection reset when kicking transports,
as in https://android-review.googlesource.com/#/c/211267/1. And I think
we can make following improvements beside that.
1. Close a file that is used in other threads isn't safe. Because the file
descriptor may be reused to open other files, and other threads may operate
on the wrong file. So use dup2(dummy_fd) to replace close() in kick function,
and really close the file descriptor after the read/write threads exit.

2. Open new usb connection after usb_close() instead of after
usb_kick(). After usb_kick(), the transport may still exist and
reader/writer for the transport may be still running. But after
usb_close(), the previous transport is guaranteed to be destroyed.

Bug: 25935458
Change-Id: I1eff99662d1bf1cba66af7e7142f4c0c4d82c01b
(cherry picked from commit 005bf1e05b)
2016-04-26 17:43:14 -07:00
Treehugger Robot
02e8b642af Merge "adb: decrease the number of fds used in fd_count test." am: c296440
am: dbb3e3b

* commit 'dbb3e3ba92b090afa32808cbb504d4c653f5311c':
  adb: decrease the number of fds used in fd_count test.

Change-Id: Id48542904272ac506eec121fa21cbed374b9408d
2016-04-27 00:11:26 +00:00
Yabin Cui
71bddf842d adb: use a custom thread to poll for usb devices on mac.
On mac, if the adb server kicks a transport on some error, mac usb driver
will not report a new usb device. So instead of relying on mac usb driver
to report new usb devices, this CL uses a loop to search for usb devices
not exist before. Note that this is also the behavior on windows and linux
host.
`adb reconnect` can be used to verity this CL.

Bug: 25935458
Change-Id: I890e0eb1fae173f2e7a0c962ededa294d821e015
(cherry picked from commit 48d4c0c42a)
2016-04-26 17:00:49 -07:00
Josh Gao
858f133d41 adb: decrease the number of fds used in fd_count test.
Default limit is 1024 fds, which means 512 socketpairs will hit the
limit.

Bug: http://b/28386497
Change-Id: Ib36404c050e4be3db51378e250f300f7ec5aab13
2016-04-26 15:45:23 -07:00
Treehugger Robot
023dc9ab5c Merge "adb: fix test_device.py shell protocol checks." am: 52eb602
am: 8a77b30

* commit '8a77b300bead94a90a62dce2e53526cd2d2071ae':
  adb: fix test_device.py shell protocol checks.

Change-Id: I92176c64aeabb9195b69efc2ced1b2c38a70de6c
2016-04-26 21:48:12 +00:00
David Pursell
cf46741b4f adb: fix test_device.py shell protocol checks.
https://android-review.googlesource.com/#/c/210646/ added a
has_shell_protocol() function but the test_device.py tests were still
trying to use the now-missing SHELL_PROTOCOL_FEATURE constant.

This CL just switches test_device.py to correctly use the
has_shell_protocol() method.

Change-Id: Ie0a2f0dc07529843d25051a01e08fb677551a4e1
Test: `python -m unittest discover -v` on devices with and without
      the shell protocol.
2016-04-26 13:29:39 -07:00
Yabin Cui
ba8498b41b Merge "adb: fix socket tests." am: e998abd
am: 61f6d1d

* commit '61f6d1df52649eb9611ca908cddd55bbad3149bc':
  adb: fix socket tests.

Change-Id: I686c5799014abdf00203a4c4df0b5c02b9ac7102
2016-04-26 03:07:44 +00:00
Yabin Cui
2407d7c3d9 adb: fix socket tests.
Bug: 28386497

Change-Id: I9f37ecadf3cfc6bb4e5da502d40f49e1f3a16d8a
2016-04-25 19:51:58 -07:00
Yabin Cui
a28918cf30 Fix kick_transport test.
Fix broken kick_transport test, and make it not access atransport
internal variables.

Bug: 25935458
Change-Id: I91b4d32a222b2f369f801bbe3903acac9c8ea4f7
(cherry picked from commit 7f27490e7f)
2016-04-25 17:37:08 -07:00
Yabin Cui
799e80334c Merge "adb: fix adb usb operations on device." am: ad2021a
am: ec4db8f

* commit 'ec4db8f14f8ecc122505f17f93ca7e34ced409b4':
  adb: fix adb usb operations on device.

Change-Id: I6daa50bfdb968ef3f1371f30ee3a378630169ce7
2016-04-25 17:41:41 +00:00
Yabin Cui
ad2021a1b1 Merge "adb: fix adb usb operations on device." 2016-04-25 17:19:03 +00:00
Zach Riggle
f9f0b5f413 Merge "Fix NULL deref on exec-in with insufficient arguments" am: 245e4dbfd4
am: a0690543da

* commit 'a0690543dac2792508caef09e9e97804b31fea24':
  Fix NULL deref on exec-in with insufficient arguments

Change-Id: Ic5e62d01fecc77aace676bf6cdf4218f93806860
2016-04-22 15:53:55 +00:00
Zach Riggle
ccafc79de7 Fix NULL deref on exec-in with insufficient arguments
(cherry-pick of 566a28169b84836fddd5ae96db9b147237ea054f.)

Bug: 28152091
Change-Id: Ib59e3bf7f26974aa09d2e6a0e1d9281d7ce25511
2016-04-22 08:08:01 -07:00
Yabin Cui
e618f6cb36 Merge "adb: use a custom thread to poll for usb devices on mac." am: 09c5fcf
am: 507f38f

* commit '507f38f6d7e8dcae4b513ea6c5f638ae43204245':
  adb: use a custom thread to poll for usb devices on mac.

Change-Id: Idc21e33a8b0942afe0f6fa18076718d71d9d34f6
2016-04-19 20:38:07 +00:00
Yabin Cui
48d4c0c42a adb: use a custom thread to poll for usb devices on mac.
On mac, if the adb server kicks a transport on some error, mac usb driver
will not report a new usb device. So instead of relying on mac usb driver
to report new usb devices, this CL uses a loop to search for usb devices
not exist before. Note that this is also the behavior on windows and linux
host.
`adb reconnect` can be used to verity this CL.

Bug: 25935458
Change-Id: I890e0eb1fae173f2e7a0c962ededa294d821e015
2016-04-19 11:26:44 -07:00
Yabin Cui
2f46a7d0ec Merge "Fix kick_transport test." am: a960864
am: 119ca23

* commit '119ca2345d97db04d4114f5031d172f3694350d4':
  Fix kick_transport test.

Change-Id: I4625174a1d62edfa8a1db52ced70356798d53c95
2016-04-19 02:57:56 +00:00
Yabin Cui
a960864355 Merge "Fix kick_transport test." 2016-04-19 02:29:29 +00:00
TreeHugger Robot
a9e818f463 Merge changes Ia4a2ff77,I970806e3,I47daa338 into nyc-dev
* changes:
  adb: increase the FD table size on Win32.
  adb: bump the server version to 36.
  adb: add reconnect command.
2016-04-19 00:51:22 +00:00
Josh Gao
826bdace3d Merge changes Iaf0efc0c,Ia4a2ff77 am: c4f3546
am: c5b388f53a

* commit 'c5b388f53a5666daa368f597c7e190f7f31f2b8a':
  adb: disable tests that are expected to fail on Win32.
  adb: increase the FD table size on Win32.

Change-Id: Ifcc55e62935c95c8b34fa0d1973277a08916fad2
2016-04-19 00:28:58 +00:00
Josh Gao
d1e2300a71 adb: increase the FD table size on Win32.
128 maximum FDs is a pretty low limit, which can easily be exhausted by
port forwarding. Bump the maximum up to 2048, and add a test that checks
whether we can actually use a few hundred sockets.

Bug: https://code.google.com/p/android/issues/detail?id=12141
Bug: http://b/28246942
Change-Id: Ia4a2ff776e8e58ec13378756f19d80392679ece9
(cherry picked from commit b31e17107c)
2016-04-18 15:46:25 -07:00
Josh Gao
988e9bc1f8 adb: bump the server version to 36.
The recent `adb root` changes are incompatible with older versions of
the server. Bump the version number to force the server to restart.

Bug: http://b/28194507
Change-Id: I970806e3b68c1f8e3273a4b1f0ecc4aca5086be9
(cherry picked from commit 057095d207)
2016-04-18 15:46:25 -07:00
Yabin Cui
03468c8c50 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
(cherry picked from commit 1f4ec19e49)
2016-04-18 15:46:25 -07:00
Josh Gao
c4f3546e9f Merge changes Iaf0efc0c,Ia4a2ff77
* changes:
  adb: disable tests that are expected to fail on Win32.
  adb: increase the FD table size on Win32.
2016-04-18 22:39:34 +00:00
Josh Gao
68c63d75c9 adb: disable tests that are expected to fail on Win32.
Bug: http://b/28247676
Change-Id: Iaf0efc0c12835c0915a752a365651eb9bc78b3b8
2016-04-18 14:33:38 -07:00
Josh Gao
b31e17107c adb: increase the FD table size on Win32.
128 maximum FDs is a pretty low limit, which can easily be exhausted by
port forwarding. Bump the maximum up to 2048, and add a test that checks
whether we can actually use a few hundred sockets.

Bug: https://code.google.com/p/android/issues/detail?id=12141
Bug: http://b/28246942
Change-Id: Ia4a2ff776e8e58ec13378756f19d80392679ece9
2016-04-18 14:33:38 -07:00
Josh Gao
e929e115be Merge "adb: bump the server version to 36." am: 3009b7c
am: a0b5c62

* commit 'a0b5c62525e7b79131df337619b268794c92374f':
  adb: bump the server version to 36.

Change-Id: I910cd4e32bd38796025d603ee86d245d33f6c61a
2016-04-18 21:29:41 +00:00
Josh Gao
3009b7cbe0 Merge "adb: bump the server version to 36." 2016-04-18 20:05:42 +00:00
Yabin Cui
7f27490e7f Fix kick_transport test.
Fix broken kick_transport test, and make it not access atransport
internal variables.

Bug: 25935458
Change-Id: I91b4d32a222b2f369f801bbe3903acac9c8ea4f7
2016-04-18 11:22:34 -07:00
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
Yabin Cui
005bf1e05b adb: fix adb usb operations on device.
Problem: For devices using /dev/usb-ffs/adb, Run
`while true; do adb reconnect device; sleep 1; done`. And the
device soon becomes offline. The adbd log shows that calling
adb_read(h->bulk_out) in usb_ffs_read() gets EOVERFLOW error.

Reason: When kicking a transport using usb-ffs, /dev/usb-ffs/adb/ep0
is not closed, and the device will not notify a usb connection reset
to host. So the host will continue to send unfinished packets even
if a new transport is started on device. The unfinished packets may
not have the same size as what is expected on device, so adbd on
device gets EOVERFLOW error. At the worst case, adbd has to create new
transports for each unfinished packet.

Fixes:
The direct fix is to make the usb connection reset when kicking transports,
as in https://android-review.googlesource.com/#/c/211267/1. And I think
we can make following improvements beside that.
1. Close a file that is used in other threads isn't safe. Because the file
descriptor may be reused to open other files, and other threads may operate
on the wrong file. So use dup2(dummy_fd) to replace close() in kick function,
and really close the file descriptor after the read/write threads exit.

2. Open new usb connection after usb_close() instead of after
usb_kick(). After usb_kick(), the transport may still exist and
reader/writer for the transport may be still running. But after
usb_close(), the previous transport is guaranteed to be destroyed.

Bug: 25935458
Change-Id: I1eff99662d1bf1cba66af7e7142f4c0c4d82c01b
2016-04-15 18:18:16 -07:00
Josh Gao
057095d207 adb: bump the server version to 36.
The recent `adb root` changes are incompatible with older versions of
the server. Bump the version number to force the server to restart.

Bug: http://b/28194507
Change-Id: I970806e3b68c1f8e3273a4b1f0ecc4aca5086be9
2016-04-15 14:54:43 -07: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
9ea7795d38 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
(cherry picked from commit 48a348183f)
2016-04-13 13:13:20 -07:00
Josh Gao
5863fb61e1 adb: add support for 'wait-for-any'.
Allow waiting for a device in any state.

Bug: http://b/28168212
Change-Id: I1876ecd70089ca88f2da5de4182e13724ec50501
(cherry picked from commit 86441c31fe)
2016-04-13 13:13:17 -07:00
Josh Gao
3d8df3cb2a 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
(cherry picked from commit 08881e72f4)
2016-04-13 13:13:14 -07: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
Josh Gao
a31ea55c55 adb: cleanup file skipping logic.
Bug: http://b/26355212
Change-Id: Iafa250ce6c5ea8da9f5f00125165e5b67ef1013f
2016-03-03 14:40:03 -08:00
David Pursell
29f8993098 Merge "adb: relax serial matching rules." am: b4709c2cfd
am: a942881fdb

* commit 'a942881fdb8925373a8b8756301fa3a4d92cf174':
  adb: relax serial matching rules.
2016-03-03 16:57:44 +00:00
David Pursell
b4709c2cfd Merge "adb: relax serial matching rules." 2016-03-03 16:44:58 +00:00
Josh Gao
7f766bc87b Merge "adb: symlinks to dirs count as dirs for pull destination." am: 543093cb97
am: 3b198fd8bb

* commit '3b198fd8bbbbb783f07e3cbd7c78973e94119534':
  adb: symlinks to dirs count as dirs for pull destination.
2016-03-03 01:40:17 +00:00
Josh Gao
543093cb97 Merge "adb: symlinks to dirs count as dirs for pull destination." 2016-03-03 00:36:22 +00:00
Josh Gao
1e611a33d5 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
2016-03-02 15:29:02 -08:00
David Pursell
3f902aad5b 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
2016-03-02 12:54:58 -08:00
bohu
32e55d70c4 Merge "Emulator: fix adbd qemu pipe partial write" am: ae607e149b
am: 4cc3354fb7

* commit '4cc3354fb75363cc8107162f338bc3872c22550c':
  Emulator: fix adbd qemu pipe partial write
2016-03-02 01:55:44 +00:00
bohu
8ac1b044af Emulator: fix adbd qemu pipe partial write
It does happens that the adb_write only writes to the
qemu pipe partially which throws host side's adb backend
into confusion and crashes.

This CL replaces adb_write with WriteFdExactly;
adb_read with ReadFdExactly.

(cherry picked from commit f66c5938be)

Change-Id: I684f5df79b1e3f00b4b7a2452c2712a73c15973c
2016-03-01 17:39:31 -08:00
Bo Hu
ae607e149b Merge "Emulator: fix adbd qemu pipe partial write" 2016-03-02 01:35:33 +00:00
bohu
f66c5938be Emulator: fix adbd qemu pipe partial write
It does happens that the adb_write only writes to the
qemu pipe partially which throws host side's adb backend
into confusion and crashes.

This CL replaces adb_write with WriteFdExactly;
adb_read with ReadFdExactly.

Change-Id: I10424ad730c73516d16b0eb7318e8c9beea9b36b
2016-03-01 17:33:57 -08:00
Josh Gao
b012c1cb1f Merge "adb: report progress for small files." am: 4c87588fa2
am: d799184236

* commit 'd799184236e8a63310f21d1509e656f9322ee300':
  adb: report progress for small files.
2016-03-01 20:38:41 +00:00
Josh Gao
9fd2f77dcc adb: report progress for small files.
Bug: http://b/27407725
Change-Id: I7515144402a487fb3d4d403e2f5f82423c1b5ed6
2016-03-01 11:52:55 -08:00
Ying Wang
3905db7616 Merge "Also archive adb.exe/fastboot.exe when building win_sdk." am: f666ba41a7
am: aa88fa5837

* commit 'aa88fa58371930b9b7aef8d942f72d7b9a29c8a7':
  Also archive adb.exe/fastboot.exe when building win_sdk.
2016-03-01 19:50:46 +00:00
Ying Wang
71edfc8b9a Also archive adb.exe/fastboot.exe when building win_sdk.
On linux we archive both Linux and Windows binaries.

Bug: 27315911
Change-Id: I17d25cd1ea611a9c917f1e78b47f21a8959eea20
2016-02-29 19:27:06 -08:00
David Pursell
56b3731203 Merge "adb: use TCP keepalive." am: e663c163ac
am: 89d749dbfc

* commit '89d749dbfc6f9f1544e59de1c1157fc1eadc205e':
  adb: use TCP keepalive.
2016-02-29 17:46:23 +00:00
David Pursell
e663c163ac Merge "adb: use TCP keepalive." 2016-02-29 17:43:35 +00:00
Josh Gao
e561a8bc4f Merge "adb: fix directory creation logic." am: a887c4faca
am: 8564dc9085

* commit '8564dc9085b9a8cccf4021a441f76b3af364d3ca':
  adb: fix directory creation logic.
2016-02-27 01:57:21 +00:00
Josh Gao
a887c4faca Merge "adb: fix directory creation logic." 2016-02-27 01:54:16 +00:00
Josh Gao
71728ca300 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
2016-02-26 14:50:24 -08:00
Josh Gao
d3ff759988 Merge "adb: fix mistaken use of PLOG." am: a692f431d6
am: 95891e5a70

* commit '95891e5a70f9b0aed6332e92f9a3204b3e5b3d58':
  adb: fix mistaken use of PLOG.
2016-02-25 22:34:32 +00:00
Josh Gao
443a52c298 adb: fix mistaken use of PLOG.
Change-Id: I60bfa3d8cf1572a877d6f0c9369d8f72f10e5aef
2016-02-25 14:14:02 -08:00
Alex Klyubin
73c6fd1af2 Merge "Only debuggable packages can be downgraded." into nyc-dev
am: 8a67c09e7d

* commit '8a67c09e7d630ccecf8eb17463511dde2f16b548':
  Only debuggable packages can be downgraded.
2016-02-25 20:29:49 +00:00
Alex Klyubin
8a67c09e7d Merge "Only debuggable packages can be downgraded." into nyc-dev 2016-02-25 20:26:54 +00:00
Josh Gao
2eaa41a6df adb: fix leak of framework_fd.
Move the fdevent for the framework authentication connection out of
atransport into its own static variable in adb_auth_client, since its
lifetime is completely unrelated to that of the USB connection.

Bug: http://b/27297963
Change-Id: Ie6180d0b59d133120c5755e239e76ab33ed3cc1d
(cherry picked from commit 9f48611554)
2016-02-25 11:01:59 -08:00
Josh Gao
b6117c4397 adb: bail out if wait_for_device fails in send_shell_command.
Bug: http://b/27166186
Change-Id: Ib7e9d7e6b909d67a3af94c3517a6a0b54cf17db7
(cherry picked from commit f56c39194f)
2016-02-25 11:01:38 -08:00
Josh Gao
63b8571dce Merge "adb: bail out if wait_for_device fails in send_shell_command." am: 4e5b292299
am: 2b7f69d0f1

* commit '2b7f69d0f1bdaa60d52e6841f2bda52506ab5ad2':
  adb: bail out if wait_for_device fails in send_shell_command.
2016-02-25 18:48:30 +00:00
Josh Gao
e0ed0f0608 Merge "adb: fix leak of framework_fd." am: 77dc40f2fa
am: 2ea5bf7b55

* commit '2ea5bf7b551799468a1f5378a2f82412db81a4c2':
  adb: fix leak of framework_fd.
2016-02-25 18:48:22 +00:00
Josh Gao
4e5b292299 Merge "adb: bail out if wait_for_device fails in send_shell_command." 2016-02-25 18:43:42 +00:00
Josh Gao
77dc40f2fa Merge "adb: fix leak of framework_fd." 2016-02-25 18:43:34 +00:00
Josh Gao
9f48611554 adb: fix leak of framework_fd.
Move the fdevent for the framework authentication connection out of
atransport into its own static variable in adb_auth_client, since its
lifetime is completely unrelated to that of the USB connection.

Bug: http://b/27297963
Change-Id: Ie6180d0b59d133120c5755e239e76ab33ed3cc1d
2016-02-24 17:56:12 -08:00
Alex Klyubin
85ed97518c Only debuggable packages can be downgraded.
This reflects the change in PackageManager service:
frameworks/base commit 921dd754ab49df0cd580ff96503f7616c4c85f4a.

Bug: 27327503
Change-Id: Ifcc7268cd271640417b8cfc9db81ea954b491cb1
2016-02-24 16:07:47 -08:00
Josh Gao
f56c39194f adb: bail out if wait_for_device fails in send_shell_command.
Bug: http://b/27166186
Change-Id: Ib7e9d7e6b909d67a3af94c3517a6a0b54cf17db7
2016-02-24 15:22:14 -08:00
Jorge Lucangeli Obes
48a1b15db1 Merge "adbd: Remove explicit capability bounding set code." am: d458730b64
am: c41b28b8bc

* commit 'c41b28b8bc03526b6ec6ec19a6d6a26ffb493a5b':
  adbd: Remove explicit capability bounding set code.
2016-02-24 22:28:25 +00:00
Jorge Lucangeli Obes
d458730b64 Merge "adbd: Remove explicit capability bounding set code." 2016-02-24 22:13:09 +00:00
Dan Willemsen
ed1d7aeee4 Remove duplicate fdevent.cpp entry
Fixes the following warnings:

build/core/binary.mk:894: warning: overriding commands for target
`out/target/product/bullhead/obj/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: ignoring old commands for target
`out/target/product/bullhead/obj/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: overriding commands for target
`out/target/product/bullhead/obj_arm/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: ignoring old commands for target
`out/target/product/bullhead/obj_arm/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'

Change-Id: Id4b13574e568284cefbc3a763d40843e73ddbd3d
(cherry picked from commit 582c8fe1d4)
2016-02-24 12:14:48 -08:00
Dan Willemsen
eafc2fdc7d Merge "Remove duplicate fdevent.cpp entry" am: 978cda5cc6
am: 1fa1791a04

* commit '1fa1791a04f03e9d3a58e599233051b94cfa08a3':
  Remove duplicate fdevent.cpp entry
2016-02-24 00:19:47 +00:00