Commit graph

1262 commits

Author SHA1 Message Date
David Pursell
74b6e8ecfd am e4c1bb53: Merge "adb: features passes transport features."
* commit 'e4c1bb53068db184ee4cb19513ffe7764a09722f':
  adb: `features` passes transport features.
2015-09-05 00:07:54 +00:00
David Pursell
e4c1bb5306 Merge "adb: features passes transport features." 2015-09-05 00:01:27 +00:00
David Pursell
3f742914b1 am 21541531: Merge changes from topic \'adb_shell_prework\'
* commit '215415318d8483d648955b72bb3b083e131cb62e':
  adb: create shell protocol class.
  adb: refactor subprocess code.
  adb: move shell service to a separate file.
2015-09-05 00:01:02 +00:00
David Pursell
215415318d Merge changes from topic 'adb_shell_prework'
* changes:
  adb: create shell protocol class.
  adb: refactor subprocess code.
  adb: move shell service to a separate file.
2015-09-04 23:54:19 +00:00
David Pursell
880be434a9 adb: features passes transport features.
`adb features` previously returned a list of host features which was
not terribly useful. This CL changes functionality to return the
transport features instead using the standard targeting args:
  $ adb features  # default target.
  $ adb -e features
  $ adb -s 123456 features

Also adds a "check-feature" service which is currently unused but will
allow the adb client to easily check for a specific feature.

Bug: http://b/23824036
Change-Id: Ibc0c420c75f73d363f3bba7705af616ba2059348
2015-09-04 16:47:21 -07:00
David Pursell
73096f2e1d adb: create shell protocol class.
Adds a new class ShellProtocol to help read and write data with
`adb shell`. This will allow splitting streams and sending out-of-band
data such as exit codes.

Nothing uses the new class yet except the unit tests.

Bug: http://b/23030641

Change-Id: Ieb02e127095c6dda25b7cb188a2e599173fd97e6
2015-09-04 11:30:11 -07:00
David Pursell
a932058504 adb: refactor subprocess code.
Refactor shell_service.cpp to remove dependencies on service.cpp and
combine some common logic between PTY and raw subprocesses.

This will make it easier to add additional common code paths for
the upcoming shell protocol.

Change-Id: I497d30dd388de61b6e68d9086dce38f33dd92876
2015-09-04 11:18:51 -07:00
Tom Cherry
b00a8a066f am e8b0fcec: Merge "combine adbd.rc with init.usb.rc"
* commit 'e8b0fcecf4a17cf37b5fefbcceef0920788f776e':
  combine adbd.rc with init.usb.rc
2015-09-04 17:56:25 +00:00
David Pursell
80f67029e0 adb: move shell service to a separate file.
Upcoming changes to the shell will require significant additions to
the subprocess code, and it will be cleaner if it's in a separate file.

The only functional change here is a new debug tag specifically for
the shell service. Everything else has been copied exactly as-is in
order to make it easier to determine what's changing in upcoming CLs.

Change-Id: I13bd4294059051ee10e0d0c6a06affd8eca62967
2015-09-04 08:52:35 -07:00
Tom Cherry
2270dbbc84 combine adbd.rc with init.usb.rc
init.usb.rc and adbd.rc contain similar contents and belong in the same
file.

This file also belongs on the ramdisk as adbd is on the ramdisk, not the
system partition, therefore resolving to keep init.usb.rc in its current
location and combining the contents of adbd.rc is the best approach

Change-Id: I430f8fea58694679e7b8b7be69ce87daadd616f4
2015-09-03 16:19:04 -07:00
Elliott Hughes
db31ac76ba am 478da637: Merge "Improve adb sync_send error reporting."
* commit '478da6374b5f4a5742566edfe3057c674a51615e':
  Improve adb sync_send error reporting.
2015-09-03 21:33:59 +00:00
Elliott Hughes
081696d27c Improve adb sync_send error reporting.
Bug: http://b/23786900
Change-Id: I71f10de8d767eaf8bf0f5d9b8c304527e2b953ff
2015-09-03 13:55:55 -07:00
Yabin Cui
7d0b4ada0b am 6562c151: Merge "adb: clean up debug tracing a little."
* commit '6562c1513b2b7bd88da8b1d0c88b89e66b2dcd69':
  adb: clean up debug tracing a little.
2015-09-03 17:38:57 +00:00
Yabin Cui
6562c1513b Merge "adb: clean up debug tracing a little." 2015-09-03 17:32:44 +00:00
Yabin Cui
7a3f8d6691 adb: clean up debug tracing a little.
Always use LOG() for debug tracing.
Remove useless D_lock. I believe it is useless to lock just before and after fprintf.

I verified the log output both on host and on device. The output looks fine to me.

Change-Id: I96ccfe408ff56864361551afe9ad464d197ae104
2015-09-02 20:21:00 -07:00
Dan Willemsen
a4b8f9f1c2 am bfe32228: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"
* commit 'bfe322285fdbe86fdc01fdc4c711e22e894bdaee':
  Remove USE_MINGW/CYGWIN; Whitelist windows modules
2015-09-03 00:39:19 +00:00
Dan Willemsen
87a419c8b1 Remove USE_MINGW/CYGWIN; Whitelist windows modules
CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.

Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
2015-09-02 17:10:35 -07:00
Elliott Hughes
1428640f5c am 5d804006: Merge "adb/base win32 tests: fix comment and open() flags"
* commit '5d8040060515128f2bee9b4759d0618b90c4d70c':
  adb/base win32 tests: fix comment and open() flags
2015-09-01 22:10:57 +00:00
Spencer Low
2fbeb0cc71 adb/base win32 tests: fix comment and open() flags
Match base's use of O_BINARY.

Change-Id: I930b5c8fddde20966580069f2e681b99cb26f1a3
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-09-01 14:57:58 -07:00
Yabin Cui
14bf82e21f am 2ae47a0b: Merge "adb: add unit test for fdevent."
* commit '2ae47a0b54c51d05cfb5bab3e1d7a34d5d15ba1b':
  adb: add unit test for fdevent.
2015-09-01 16:37:39 +00:00
Yabin Cui
7a3dc5eacf am 1e19317e: Merge "adb: improve names for transport threads."
* commit '1e19317e575e1020cc0c241c4591a3f95f6a45c4':
  adb: improve names for transport threads.
2015-09-01 16:37:35 +00:00
Yabin Cui
85c04dfeb6 am 1531cee6: Merge "adb: remove workaround for b/6558362."
* commit '1531cee658ecc46a8eda3c1bc13a09fd4fa73eb9':
  adb: remove workaround for b/6558362.
2015-09-01 16:37:22 +00:00
Elliott Hughes
7dbc0936e8 am b6bfd36c: Merge "Distinguish transport threads."
* commit 'b6bfd36c19626ef1aca3b5d28092721c6b498a34':
  Distinguish transport threads.
2015-09-01 16:36:41 +00:00
Siva Velusamy
1f9d3b07a6 am c9525ec3: Merge "adb: set thread names (linux & mac)"
* commit 'c9525ec366232aa6a0968be1cc8e8abc37df789f':
  adb: set thread names (linux & mac)
2015-09-01 16:36:29 +00:00
Yabin Cui
2ae47a0b54 Merge "adb: add unit test for fdevent." 2015-08-31 22:40:04 +00:00
Yabin Cui
1e19317e57 Merge "adb: improve names for transport threads." 2015-08-31 21:21:21 +00:00
Yabin Cui
d6ab3c2245 adb: improve names for transport threads.
The old names seems confusing. output_thread was reading remote data and writing to
local sockets. input_thread was reading local sockets data and writing to remote.
This change tries to make it clear by renaming output_thread to read_transport thread,
and renaming input_thread to write_transport thread.

Change-Id: I2e7b4cde7a94d436f3745e9e3ab10780e7caa8ac
2015-08-31 13:34:27 -07:00
Yabin Cui
c6424585a2 adb: remove workaround for b/6558362.
I believe the problem has been fixed in https://android-review.googlesource.com/#/c/168412/.
So it's time to remove the workaround.

Bug: 6558362
Change-Id: I399c18eda0693f3c51feac07ff59a0a4b5558128
2015-08-31 12:10:11 -07:00
Elliott Hughes
0c3914a44d Distinguish transport threads.
Use "<-" and "->" to work around Linux's very short thread name limit.

Bug: http://b/23423333
Change-Id: I9f3f096415b47162dacb660cd0a97ac7ff6107e6
2015-08-31 10:46:05 -07:00
Siva Velusamy
49ee7cf9a1 adb: set thread names (linux & mac)
Bug: 23423333
Change-Id: I0069f32ddbae2a10fb130064f721facf45b2cc09
2015-08-31 07:52:52 -07:00
Yabin Cui
bec02fc43d adb: add unit test for fdevent.
Change-Id: Ic26cda5d8e84425bc60ce36bc686bb6917c4ca3c
2015-08-28 21:33:22 -07:00
Elliott Hughes
b77146ce7c am 9f07f879: Merge "fatal and fatal_errno should be noreturn."
* commit '9f07f87908f072d63d8bb9ded91616af8d3edbb4':
  fatal and fatal_errno should be noreturn.
2015-08-29 02:30:50 +00:00
Yabin Cui
432ea8f94e am a3bdc6ab: Merge "adb: clean up transport disconnect operations."
* commit 'a3bdc6aba29950b38a4c8ab785e5828451e97140':
  adb: clean up transport disconnect operations.
2015-08-29 02:30:49 +00:00
Elliott Hughes
9f07f87908 Merge "fatal and fatal_errno should be noreturn." 2015-08-29 02:22:18 +00:00
Yabin Cui
a3bdc6aba2 Merge "adb: clean up transport disconnect operations." 2015-08-29 02:21:46 +00:00
Elliott Hughes
2f3342fa33 fatal and fatal_errno should be noreturn.
Change-Id: I9c5d9cb5ed743d13e65112a111cc9544ec5da339
2015-08-28 19:13:10 -07:00
Yabin Cui
b329824e6c adb: clean up transport disconnect operations.
Move operations from global functions into member functions.
Add unit test.

Change-Id: Id4543d8e78541eb08c8e629f180c605c699737ec
2015-08-28 16:36:00 -07:00
Elliott Hughes
9382e6c071 am f6224587: Merge "Improve adb tracing."
* commit 'f6224587e5fdb8d659172ba5a87a55685a94adf7':
  Improve adb tracing.
2015-08-28 23:09:40 +00:00
Elliott Hughes
f6224587e5 Merge "Improve adb tracing." 2015-08-28 21:56:46 +00:00
Elliott Hughes
bd4b1fa4a9 Improve adb tracing.
The existing format was unreadable; putting the pid and tid first helps
somewhat. Also remove the unused qemu tracing which wasn't called anywhere.

Change-Id: I37ef3c556fe17b237ba1d8ca3216e2155ce5d0de
2015-08-28 14:46:33 -07:00
Yabin Cui
bbe5de2307 am 88a51cd4: Merge "adb: call run_transport_disconnects() only once."
* commit '88a51cd4d8377516f693720f427511cb40e90b75':
  adb: call run_transport_disconnects() only once.
2015-08-28 20:59:30 +00:00
Yabin Cui
88a51cd4d8 Merge "adb: call run_transport_disconnects() only once." 2015-08-28 20:50:07 +00:00
Elliott Hughes
bffa890641 am e73a8a23: Merge "win32: adb start-server shows stdout/stderr output from actual server"
* commit 'e73a8a2388f019b0f7a6e468af27056edbb02521':
  win32: adb start-server shows stdout/stderr output from actual server
2015-08-28 20:23:49 +00:00
Elliott Hughes
e73a8a2388 Merge "win32: adb start-server shows stdout/stderr output from actual server" 2015-08-28 20:13:40 +00:00
Elliott Hughes
4417c38a1e am a54f14eb: Merge "adb unittest: get test_unicode_paths passing on win32"
* commit 'a54f14eb95d73c91aaa2a4387a79d897a4731060':
  adb unittest: get test_unicode_paths passing on win32
2015-08-28 20:07:47 +00:00
Elliott Hughes
a54f14eb95 Merge "adb unittest: get test_unicode_paths passing on win32" 2015-08-28 20:00:53 +00:00
Elliott Hughes
be881b65ca am 1d9253f2: Merge "adb: fix adb install and adb push exit code, error handling, unittest"
* commit '1d9253f255c60069c4187f0c43b2b22015fd5688':
  adb: fix adb install and adb push exit code, error handling, unittest
2015-08-28 19:52:18 +00:00
Elliott Hughes
1d9253f255 Merge "adb: fix adb install and adb push exit code, error handling, unittest" 2015-08-28 19:46:46 +00:00
Yabin Cui
adab77ad50 am 7b6fa7ed: Merge "adb: remove adisconnect in aremotesocket."
* commit '7b6fa7ed304cbd682e4c4cb539f2e4f8047aedc4':
  adb: remove adisconnect in aremotesocket.
2015-08-28 18:57:35 +00:00
Yabin Cui
12d7f0909a adb: call run_transport_disconnects() only once.
Currently run_transport_disconnects() are called twice. One is in
handle_offline(), another is before destroying transport.
The users of disconnect callback are listener, adb_auth_client, and
remote_sockets. All of them need only to be called once. And after
handle_offline, no new listeners, adb_auth_client, or remote_sockets
can be connected to the offlined transport. So I think we can remove
the second call to run_transport_disconnects().

Change-Id: I1ef8b6b7b5ab7ae1bad109be107c85973d65a2e3
2015-08-28 11:39:37 -07:00