Commit graph

1917 commits

Author SHA1 Message Date
Josh Gao
79a69f0bd7 Merge changes Ia59c6dbe,I13b17bcd
am: 0b47d08303

Change-Id: Ica4c5de30e12f6950f0a9f3a2dc94213ef2fe70a
2016-06-23 21:25:10 +00:00
Josh Gao
e31a7a4ce4 adb: fix fd leak when shell fails to create a thread.
Bug: http://b/29565233
Change-Id: Ia59c6dbe5ac033425c11739579e85cbcad1170d1
2016-06-23 13:14:49 -07:00
Josh Gao
cd5d7376dc adb: don't dup local socket fd.
SIGHUP handling depends on the local socket fd being fully closed in
order to trigger an event on its counterpart. Release the local socket
fd inside of Subprocess when returning it to ensure this.

Functionally, a cherry-pick of internal commit 42afe20.

Bug: http://b/29565233
Change-Id: I13b17bcddf0b396a5f4880f9e410fbbf24d9370d
2016-06-22 19:09:42 -07:00
Elliott Hughes
a81117b8f9 Merge \"Address old review comments in adb_auth_host.cpp.\"
am: 57bbedc036

Change-Id: I0ab20c9258d42e6b0b847e8eb69382005f086706
2016-06-22 17:17:51 +00:00
Treehugger Robot
57bbedc036 Merge "Address old review comments in adb_auth_host.cpp." 2016-06-22 17:09:26 +00:00
Elliott Hughes
625faf0196 Address old review comments in adb_auth_host.cpp.
Comments from:
https://android-review.googlesource.com/#/c/212781/4/adb/adb_auth_host.cpp@107

Bug: http://b/28152031
Change-Id: I27d062f3eeb8db90f94b1b4f5d7204000a7ac73d
Test: manually removed ~/.android/adb* and checked they were recreated correctly.
2016-06-22 08:38:47 -07:00
David 'Digit' Turner
1c01bae82a Merge \"[qemu]: Move qemu_pipe.h from include/system/ directory.\"
am: 44b7339aa2

Change-Id: I59b9a896058dea76f69b9ba757890d4a42952a66
2016-06-21 08:05:18 +00:00
David Turner
44b7339aa2 Merge "[qemu]: Move qemu_pipe.h from include/system/ directory." 2016-06-21 07:38:02 +00:00
Josh Gao
88347e1430 Merge changes from topic \'debuggerd_client\'
am: abf88685e3

Change-Id: I2a61e4e8b5ec5a4ab6566ab4f8eb31653255fbc5
2016-06-20 20:47:18 +00:00
Josh Gao
34c6ca01ff Merge \"adb: fix fd double close, Subprocess lifetime issue.\"
am: b23e5729a8

Change-Id: I96db140e4316b767fb632307a435bc3e22cbfb36
2016-06-20 20:47:17 +00:00
Treehugger Robot
abf88685e3 Merge changes from topic 'debuggerd_client'
* changes:
  adb: use libdebuggerd_client.
  debuggerd: add libdebuggerd_client.
2016-06-20 20:22:18 +00:00
Josh Gao
344778da41 adb: fix fd double close, Subprocess lifetime issue.
This commit fixes two somewhat related issues in shell_service.

  - The fd returned by StartSubprocess is owned by a unique_fd
    contained in the Subprocess object, but also gets closed by the
    caller. Resolve this by duping the returned file descriptor.

  - A Subprocess object can be destroyed immediately after its initial
    construction in StartSubprocess if we're sufficiently unlucky.
    Split up the fork/exec and "start management thread" steps, so that
    we can safely do everything we need to do on the Subprocess before
    handing it over to the thread that'll eventually destroy it.

Bug: http://b/29254462
Change-Id: Id9cf0b7e7a7293bee7176919edc758597691c636
2016-06-20 11:40:16 -07:00
Josh Gao
809607ae28 adb: use libdebuggerd_client.
Bug: http://b/24414818
Change-Id: I177708877488e5c4f99c453498485a2daa9b79b0
2016-06-17 13:11:29 -07:00
David 'Digit' Turner
c7b098ceb5 [qemu]: Move qemu_pipe.h from include/system/ directory.
The <hardware/qemu_pipe.h> header isn't related to any loadable
hardware module, this patch thus relocates it to <system/qemu_pipe.h>
which is a much more logical location.

Note the following changes:

  - The pipe name must begin with the 'pipe:' prefix to avoid an
    un-necessary snprintf() and buffer copy.

  - Does not probe for the obsolete /dev/goldfish_pipe device, i.e.
    only use /dev/qemu_pipe instead.

  - Use QEMU_PIPE_DEBUG() instead of D() as the debugging macro.

+ Update ADB to use the newest <system/qemu_pipe.h>

+ Add qemu_pipe_frame_send() and qemu_pipe_frame_recv() utility
  functions which replace the obsolete qemud_channel_send() and
  qemud_channel_recv() from the defunct <hardware/qemud.h>
  header.

BUG=25875346

Change-Id: Ic290a5b79d466c2af64b49bd9134643277c11bfd
2016-06-17 09:21:59 +02:00
Josh Gao
ba7aea829b Merge \"adb: make adb root not wait-for-device.\"
am: 81e59ca5a7

Change-Id: I231ad44c7b6293256f33eb3fd617b4e5da728ca1
2016-06-16 22:41:08 +00:00
Treehugger Robot
81e59ca5a7 Merge "adb: make adb root not wait-for-device." 2016-06-16 22:26:41 +00:00
Josh Gao
05824734ac adb: make adb root not wait-for-device.
`adb root` would hang for devices connected over TCP/IP, because they
never come back. Unfortunately, there doesn't seem to be an easy way to
find out what we're talking to, so replace it with a long sleep for now.

Bug: http://b/27836058
Change-Id: Icd6e6bf817ca9e2124c2961665c37b2f31f7ef29
2016-06-16 14:02:01 -07:00
Elliott Hughes
c63439ae7f Merge \"Better diagnostics from \"adb sideload\".\"
am: edd401e24e

Change-Id: I36b23f7533bbd4d6d9d9e171c297155846734a63
2016-06-15 23:29:30 +00:00
Treehugger Robot
edd401e24e Merge "Better diagnostics from "adb sideload"." 2016-06-15 23:18:52 +00:00
Elliott Hughes
b94f3c597c Merge \"Minor adb style fixes.\"
am: 35151f49ca

Change-Id: I84187cdafe76026ac58d90f4510979cff4e2afe5
2016-06-15 22:48:43 +00:00
Elliott Hughes
14415142c9 Better diagnostics from "adb sideload".
Well, slightly less bad diagnostics, anyway.

Change-Id: Idf5612f7dcb9bdbd7252163889e2612ba197426d
2016-06-15 15:09:47 -07:00
Elliott Hughes
ffc73a39fd Minor adb style fixes.
Change-Id: Ic4b45828dfdf88ef6c0fc468f66df3e62d2fbe51
2016-06-15 14:46:56 -07:00
Elliott Hughes
e691def5df Merge \\"Fix the sense of a test in \\"adb sideload\\".\\" am: 62cc17de8c
am: e9dfa4f753

Change-Id: If5dbbcaa7452b17b3e383daf7bbfc037108c10a3
2016-06-13 23:41:24 +00:00
Elliott Hughes
356fd364ad Fix the sense of a test in "adb sideload".
Change-Id: I516a2ad2d74d9322ff9eb2e4cd3c3829e5cbda99
2016-06-13 15:01:13 -07:00
Felipe Leme
e1d64b4eaf Merge \"Redirect bugreport stderr to host\'s stderr.\" into nyc-dev
am: 6d349051ce

Change-Id: I7ed56de80ff6ac698fb62820f24fca940d7c0905
2016-06-08 23:41:22 +00:00
TreeHugger Robot
6d349051ce Merge "Redirect bugreport stderr to host's stderr." into nyc-dev 2016-06-08 23:35:12 +00:00
Felipe Leme
d1dd125bc2 Redirect bugreport stderr to host's stderr.
Change-Id: I46f474f0b0d5cacdc4b129eab1bb0a7f52ccece0
Fixes: 29161586
2016-06-08 11:09:34 -07:00
Elliott Hughes
e4e6864e72 Merge \\"Set file capabilities on adb sync/push.\\" am: a500cf9cdf
am: 4e4a274e96

Change-Id: Ife5e12dcbf019d740ac642adf25aec75c006b2c8
2016-06-08 17:26:17 +00:00
Treehugger Robot
a500cf9cdf Merge "Set file capabilities on adb sync/push." 2016-06-08 17:19:41 +00:00
Elliott Hughes
32c60b4ced Set file capabilities on adb sync/push.
Bug: http://b/29180022
Change-Id: Ia21ebf0972af41b0a3becc1189ed836fd74ae5c8
2016-06-08 09:16:28 -07:00
Elliott Hughes
75f42d7ea7 Allow multiple (sequential) adb users on Linux.
Before this, adb will fail to start for the second user who tries because
/tmp/adb.log already exists and isn't writable by the second user.

Also allow $TMPDIR to override the use of /tmp.

Bug: http://b/29201686
Bug: https://code.google.com/p/android/issues/detail?id=211420

(cherry picked from commit d89a6c2285)

Change-Id: Ibb1369e8043feb9774593e317dcd7bb93323fd89
2016-06-08 08:36:19 -07:00
Elliott Hughes
fff3e52617 Merge \\"Allow multiple (sequential) adb users on Linux.\\" am: 6bf8d26c82
am: b227e61c41

Change-Id: Ibed97f2d5ac4ae9c307871cc516a81c2eb761bcd
2016-06-08 14:36:36 +00:00
Elliott Hughes
d89a6c2285 Allow multiple (sequential) adb users on Linux.
Before this, adb will fail to start for the second user who tries because
/tmp/adb.log already exists and isn't writable by the second user.

Also allow $TMPDIR to override the use of /tmp.

Bug: https://code.google.com/p/android/issues/detail?id=211420
Change-Id: Ic53da981ac0fa45bfed62e7b351d75dca0540235
2016-06-07 14:53:21 -07:00
David Pursell
27a68ef007 Merge "adbd: properly close subprocess pipes on Ctrl+C." am: 605628d325
am: 5701c58296

* commit '5701c58296b7ae84e8b9e67b6103ffdf63550fc7':
  adbd: properly close subprocess pipes on Ctrl+C.

Change-Id: I361b9ed8ce1d12487d88850635bf1b60c1b675c4
2016-06-06 21:25:03 +00:00
David Pursell
a6d5661140 adbd: properly close subprocess pipes on Ctrl+C.
When non-interactive sessions exit via Ctrl+C, adbd sends SIGHUP
to the child process to let it know to exit. However, adbd was not
closing the pipes to the child process, so if the subprocess ignored
SIGHUP and continued writing it could fill up the pipe and block
forever while adbd waits for it to exit.

This CL adds the necessary calls to close the subprocess pipe after
sending SIGHUP.

Bug: 28981563
Change-Id: I318e322e563241052648361172f4859c297837fb
(cherry picked from commit f2aa186c7b)
2016-06-06 12:56:52 -07:00
David Pursell
f2aa186c7b adbd: properly close subprocess pipes on Ctrl+C.
When non-interactive sessions exit via Ctrl+C, adbd sends SIGHUP
to the child process to let it know to exit. However, adbd was not
closing the pipes to the child process, so if the subprocess ignored
SIGHUP and continued writing it could fill up the pipe and block
forever while adbd waits for it to exit.

This CL adds the necessary calls to close the subprocess pipe after
sending SIGHUP.

Bug: 28981563
Change-Id: I318e322e563241052648361172f4859c297837fb
2016-06-06 09:59:34 -07:00
Siqi Lin
8edfe2040b Revert "adb: close ep0 on disconnection."
am: 8c4076295e

* commit '8c4076295ebd867d276636d673b9f8e6a8df01a6':
  Revert "adb: close ep0 on disconnection."

Change-Id: I74112ef3f508016238a3eb1224292aa4d77334d5
2016-06-03 04:46:25 +00:00
Siqi Lin
8c4076295e Revert "adb: close ep0 on disconnection."
This reverts commit 69e97e4bee.

Bug: 28932120
Change-Id: I5e2569abed316c089886556c432bfe59bca08549
(cherry picked from commit 57de0514f0)
2016-06-02 17:30:43 -07:00
Elliott Hughes
8d96370fb2 Merge "Kill adb\'s ScopedFd for unique_fd." am: 0f3fde210d
am: b8901de2ad

* commit 'b8901de2adca421ad10d91cdfd35851f0473464a':
  Kill adb's ScopedFd for unique_fd.

Change-Id: Idb0559a08423b9985058866ba906580353e5a7e5
2016-05-28 02:17:19 +00:00
Elliott Hughes
2ce86e527b Kill adb's ScopedFd for unique_fd.
It's the adb unique_fd, but at least it's the same API...

Change-Id: If5d6642457e145c450374fde6f1358e5ac386a96
2016-05-27 17:51:24 -07:00
Elliott Hughes
500c7e5bc7 Merge "Kill load_file." am: b42e4a6b63
am: 198a727891

* commit '198a727891aef33469d82b263fc222e4f4335b1b':
  Kill load_file.

Change-Id: I81d715153b8b882ace9deb073abfc4dde5535811
2016-05-28 00:30:31 +00:00
Elliott Hughes
e8b663fec3 Kill load_file.
Change-Id: I6c332f7d8e94d513605295b3d4d32c4e1cf878dc
2016-05-27 16:14:02 -07:00
Yurii Zubrytskyi
dace015269 [adb] Followup CL to clean up adb_auth_host.cpp
Get rid of unused includes + replace a fixed-size buffer with an
std::string

(cherry-pick of 049ebb810f466d916ec9e73cdf28624b57a8c25d.)

Change-Id: I4f9927b900a79a012b5d52908b9d22ac3d2a401c
2016-05-27 14:43:26 -07:00
Yurii Zubrytskyi
376b27532c [adb] Issue the "auth" emulator command before any other one
Emulator console now requires authentication; this means
'adb emu ...' commands silently fail because of it.
This CL adds an 'auth <token>' command to each user command,
making sure it won't be silently ignored.

(cherry-pick of a9e2b99a7fdd31bcd6d852c6db26fe592236a24f.)

Bug: https://code.google.com/p/android/issues/detail?id=211233
Change-Id: Id9ca4999fd2e6393cc88278eaf444243e13c0ec0
2016-05-27 13:34:40 -07:00
Yurii Zubrytskyi
1098c529d1 [adb] Followup CL to clean up adb_auth_host.cpp
am: 049ebb810f

* commit '049ebb810f466d916ec9e73cdf28624b57a8c25d':
  [adb] Followup CL to clean up adb_auth_host.cpp

Change-Id: I6e7d1a1e0fe58648f3a3bf12aef6507f990de123
2016-05-27 19:36:31 +00:00
Yurii Zubrytskyi
f48adf6351 resolve merge conflicts of a9e2b99 to nyc-dev-plus-aosp
Change-Id: Ic77afb008f68ebc455d3a788119b669a52a254dc
2016-05-27 11:07:40 -07:00
Yurii Zubrytskyi
049ebb810f [adb] Followup CL to clean up adb_auth_host.cpp
Get rid of unused includes + replace a fixed-size buffer with an
std::string

Change-Id: I4f9927b900a79a012b5d52908b9d22ac3d2a401c
2016-05-26 18:12:15 -07:00
Yurii Zubrytskyi
a9e2b99a7f [adb] Issue the "auth" emulator command before any other one
Emulator console now requires authentication; this means
'adb emu ...' commands silently fail because of it.
This CL adds an 'auth <token>' command to each user command,
making sure it won't be silently ignored.

Bug: https://code.google.com/p/android/issues/detail?id=211233
Change-Id: Id9ca4999fd2e6393cc88278eaf444243e13c0ec0
2016-05-26 18:11:59 -07:00
Yabin Cui
16dad488b3 Merge "adb: retry connecting disconnected emulators instead of always looping." am: 50e91fec0e
am: cfb0c5cd91

* commit 'cfb0c5cd913b689c8f9d0d930c92c6a0804e2995':
  adb: retry connecting disconnected emulators instead of always looping.

Change-Id: I4b7f30bd3738ce53eb343e5d0e20f3d20faf7e2a
2016-05-26 02:10:10 +00:00
Yabin Cui
50e91fec0e Merge "adb: retry connecting disconnected emulators instead of always looping." 2016-05-26 01:32:53 +00:00