Commit Graph

16622 Commits

Author SHA1 Message Date
Dan Albert 1792c23cb8 Add feature list to connection banner.
This allows us to test for features explicitly rather than relying on
the protocol version number, allowing us to fall back gracefully if a
feature is not supported.

This will be needed for the upcoming shell upgrades for stdout/stderr
separation and exit code reporting.

Change-Id: Ibb1d8ad2611f7209901ee76d51346b453e9c5873
2015-08-14 08:24:37 -07:00
Elliott Hughes 2733c14232 am 2416b832: am 15c6de75: Merge "Start iterating USB pipe endpoints from 1."
* commit '2416b8320cdce59ae267d60d89b0ef96de6a9d95':
  Start iterating USB pipe endpoints from 1.
2015-08-14 03:21:47 +00:00
Elliott Hughes 60f9026e4e am b4aa1777: am 782daf89: Merge "Fix the Mac libbase build."
* commit 'b4aa177701a2ddcd3390eccc95c0e06cd9b587ef':
  Fix the Mac libbase build.
2015-08-14 03:21:45 +00:00
Elliott Hughes 2416b8320c am 15c6de75: Merge "Start iterating USB pipe endpoints from 1."
* commit '15c6de753020bfa029e4add5aa8bf86b44efcc2b':
  Start iterating USB pipe endpoints from 1.
2015-08-14 03:18:47 +00:00
Elliott Hughes b4aa177701 am 782daf89: Merge "Fix the Mac libbase build."
* commit '782daf892d5f68e51200a4da48e9ab1bc1dedd23':
  Fix the Mac libbase build.
2015-08-14 03:18:45 +00:00
Elliott Hughes 15c6de7530 Merge "Start iterating USB pipe endpoints from 1." 2015-08-14 03:10:56 +00:00
Elliott Hughes 782daf892d Merge "Fix the Mac libbase build." 2015-08-14 03:10:34 +00:00
Elliott Hughes 2e5ae0044a Fix the Mac libbase build.
Change-Id: I34224fa66850915ef47c88ef4c79efbc53f3f38e
2015-08-13 20:09:29 -07:00
Elliott Hughes 2d4f852da4 Start iterating USB pipe endpoints from 1.
Bug: http://b/22829602
Change-Id: I5051880730ba8fadae5d78f1d19b5d527610d4a5
2015-08-13 16:00:12 -07:00
Siva Velusamy b3d3e24585 am ba7284ae: am 4d40c03b: Merge "adb: On Mac, clear both host and device endpoints at startup"
* commit 'ba7284aee2df23d80eda3a78e73d98eaed8e16a7':
  adb: On Mac, clear both host and device endpoints at startup
2015-08-13 22:06:28 +00:00
Siva Velusamy ba7284aee2 am 4d40c03b: Merge "adb: On Mac, clear both host and device endpoints at startup"
* commit '4d40c03b0bb86050759cdb010dce04492f54ae3e':
  adb: On Mac, clear both host and device endpoints at startup
2015-08-13 21:58:50 +00:00
Siva Velusamy 4d40c03b0b Merge "adb: On Mac, clear both host and device endpoints at startup" 2015-08-13 21:51:34 +00:00
Siva Velusamy d8b48a6281 adb: On Mac, clear both host and device endpoints at startup
This CL clears both the host and device endpoints right at the
beginning when the bulk endpoints are identified. This is in general
a "good idea", but more specifically for us, it fixes the issue
that sometimes when adb quits, it clears the endpoint on the host,
but not on the device which resulted in a subsequent invocation of
adb was seeing a stall.

Bug: https://code.google.com/p/android/issues/detail?id=182151

Change-Id: I331fa6805c40d1f50c153c010ceecd2f6a4045eb
2015-08-13 14:32:50 -07:00
Elliott Hughes bf449983ce am e1c3a7c1: am 45288223: Merge "libbase: logging fixes"
* commit 'e1c3a7c19e790a9bbffb1dba012a24de0c9e53e2':
  libbase: logging fixes
2015-08-13 21:25:53 +00:00
Elliott Hughes e1c3a7c19e am 45288223: Merge "libbase: logging fixes"
* commit '45288223d0ce864b84aa2d3e0321c0276c136ae1':
  libbase: logging fixes
2015-08-13 21:20:49 +00:00
Elliott Hughes 45288223d0 Merge "libbase: logging fixes" 2015-08-13 21:10:37 +00:00
Spencer Low bdab59a861 libbase: logging fixes
Win32:

- getprogname(): call basename() which is available in mingw's crt.
  Don't potentially go recursive with DCHECK_GT().

- Use Win32 critical section instead of mutex.

Other:

- Change log_characters check to compile-time.

- Fix code that gets the basename of __FILE__. The previous code was not
  setting _file, so it didn't work.

- Save and restore errno for LOG calls. Inspired by similar Chromium code.

Change-Id: Ie7bb700918be726fa81d60177d1894d2daeff296
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-13 14:08:31 -07:00
Nick Kralevich 1deb03179c am 51ffedd2: am 1efef4c4: Merge "Revert "init: add LOCAL_SANITIZE := integer""
* commit '51ffedd264389730a76470408a122589f7ce3488':
  Revert "init: add LOCAL_SANITIZE := integer"
2015-08-13 18:27:36 +00:00
Nick Kralevich 51ffedd264 am 1efef4c4: Merge "Revert "init: add LOCAL_SANITIZE := integer""
* commit '1efef4c49d59446d3c589563a040b0fbbd8ed73a':
  Revert "init: add LOCAL_SANITIZE := integer"
2015-08-13 18:21:35 +00:00
Nick Kralevich 1efef4c49d Merge "Revert "init: add LOCAL_SANITIZE := integer"" 2015-08-13 18:15:11 +00:00
Nick Kralevich c307b5b7f8 Revert "init: add LOCAL_SANITIZE := integer"
flounder isn't booting

This reverts commit aea73db1e3.

Bug: 23166814
Change-Id: I36c811d1ca30e2366066142d9282bb713dae315f
2015-08-13 18:10:50 +00:00
Elliott Hughes f36aa8ec5d am 5563b77a: am 57532b2a: Merge "adb: improve network error info"
* commit '5563b77a138faa622d1ba164599bf6be88997f84':
  adb: improve network error info
2015-08-13 18:00:45 +00:00
Elliott Hughes 5563b77a13 am 57532b2a: Merge "adb: improve network error info"
* commit '57532b2a067082fa5968094c2c615f1832fa1971':
  adb: improve network error info
2015-08-13 17:54:48 +00:00
Elliott Hughes 57532b2a06 Merge "adb: improve network error info" 2015-08-13 17:49:21 +00:00
Elliott Hughes 5e60d25d66 am 1685b099: am 8836031b: Merge "adb: win32: fix shutdown deadlock"
* commit '1685b09921ae2057acbd9655778660a2e81ec6b3':
  adb: win32: fix shutdown deadlock
2015-08-13 17:15:02 +00:00
Elliott Hughes 1685b09921 am 8836031b: Merge "adb: win32: fix shutdown deadlock"
* commit '8836031b27f7c62a801501f1da7d09dc3db9686d':
  adb: win32: fix shutdown deadlock
2015-08-13 17:08:46 +00:00
Elliott Hughes 8836031b27 Merge "adb: win32: fix shutdown deadlock" 2015-08-13 17:02:16 +00:00
Elliott Hughes 56d11898aa am 80e83972: am 9537ca80: Merge "adb: start-server and kill-server error output"
* commit '80e83972d0bce74d218f72b76339e6761ad6b03b':
  adb: start-server and kill-server error output
2015-08-13 16:46:46 +00:00
Elliott Hughes 80e83972d0 am 9537ca80: Merge "adb: start-server and kill-server error output"
* commit '9537ca803f86043212bfee13e8a13b7da2a9db59':
  adb: start-server and kill-server error output
2015-08-13 16:41:25 +00:00
Elliott Hughes 9537ca803f Merge "adb: start-server and kill-server error output" 2015-08-13 16:35:36 +00:00
Spencer Low f18fc0879b adb: start-server and kill-server error output
- handle_host_request
  - When the host:kill command comes in, shutdown the socket before
    calling exit(). If we don't do this, the client will output error info
    even though everything is working ok.

- adb_connect()
  - If we can't parse the version string, explain this in error output
    and don't goto error which would try to close an fd we already closed.
  - If host:kill doesn't work, output error info. Don't try to close
    already closed fd.

- adb_main()
  - If writing the ACK somehow has an error, output error info (I doubt
    this will ever get hit).

- adb_commandline()
  - Fix typo about max port number.
  - Make 'adb kill-server' and 'adb start-server' output any detailed
    error info.

Change-Id: Id1a309cc1bf516f7f49bd332b34d30f148b406da
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-12 20:14:55 -07:00
Spencer Low 87e97ee305 adb: win32: fix shutdown deadlock
adb can hang at shutdown due to a deadlock relating to WSACleanup().
This works around the issue by not calling WSACleanup() which shouldn't
be done anyway since threads aren't done using Winsock at shutdown.

A quick way to reproduce the original problem is to run many instances
of adb, many of which will call exit() soon:

  for /l %i in (1,1,20) do @start adb nodaemon server

You may have to boost the 20 to 200, or set ADB_TRACE=1 or use Windows
10 instead of Windows 7, to affect the timing, but eventually there
should be hung adb processes with that repro.

A more complete fix to prevent problems like this from occuring in the
future, would be to additionally do the following:

- Investigate all static destructors that are called when exit() is
  called.

- If they don't do anything important, switch all calls to exit() to
  instead call _exit() and then ban exit() from being called.

Change-Id: Id1be3bf0053809a45f2eca4461e4c35b5ef9388d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-12 18:19:16 -07:00
Riley Andrews 87ea6cfb62 am bc2cdfa8: am b81c410a: Merge "Added file permissions for binder tracing"
* commit 'bc2cdfa8a00980f4c38ebcd67bac888b355e3787':
  Added file permissions for binder tracing
2015-08-12 23:43:02 +00:00
Riley Andrews bc2cdfa8a0 am b81c410a: Merge "Added file permissions for binder tracing"
* commit 'b81c410abe92e7ebf227a633002da51bcdc6ea65':
  Added file permissions for binder tracing
2015-08-12 23:36:31 +00:00
Riley Andrews b81c410abe Merge "Added file permissions for binder tracing" 2015-08-12 23:28:08 +00:00
Riley Andrews c1490ad9a0 am 4a4dc5f3: am a3a193ff: Merge "Added shell permisisons for memreclaim tracing"
* commit '4a4dc5f313953764079a4020a3791e36ec43ba0c':
  Added shell permisisons for memreclaim tracing
2015-08-12 23:26:34 +00:00
Riley Andrews 4a4dc5f313 am a3a193ff: Merge "Added shell permisisons for memreclaim tracing"
* commit 'a3a193ffd9ee69a8b4dc41a592257bc134bc40da':
  Added shell permisisons for memreclaim tracing
2015-08-12 23:21:58 +00:00
Scott Bauer cd1d99e268 Added file permissions for binder tracing 2015-08-12 16:20:51 -07:00
Riley Andrews a3a193ffd9 Merge "Added shell permisisons for memreclaim tracing" 2015-08-12 23:13:38 +00:00
David Pursell 6eef56fb7a am 697869c4: am 6fefa36c: Merge "adb: Fix PTY logic for non-interactive shells."
* commit '697869c4fde93a23cda3a0d789c1f101f82eb157':
  adb: Fix PTY logic for non-interactive shells.
2015-08-12 22:29:00 +00:00
David Pursell 697869c4fd am 6fefa36c: Merge "adb: Fix PTY logic for non-interactive shells."
* commit '6fefa36cf248397377b87b543dc47c1d9dba0eaa':
  adb: Fix PTY logic for non-interactive shells.
2015-08-12 22:22:57 +00:00
David Pursell 6fefa36cf2 Merge "adb: Fix PTY logic for non-interactive shells." 2015-08-12 22:16:20 +00:00
David Pursell d4093f191b adb: Fix PTY logic for non-interactive shells.
Change `adb shell` so that interactive sessions use a PTY but
non-interactive do not. This matches `ssh` functionality better
and also enables future work to split stdout/stderr for
non-interactive sessions.

A test to verify this behavior is added to test_device.py with
supporting modifications in device.py.

Bug: http://b/21215503
Change-Id: Ib4ba40df85f82ddef4e0dd557952271c859d1c7b
2015-08-12 14:16:22 -07:00
Yabin Cui 63a29199f3 am 87f73de9: am 317acfb8: Merge "Remove confusing variable HOST."
* commit '87f73de9e9b0a74e4b963e8b49d90bbe81a38bb0':
  Remove confusing variable HOST.
2015-08-12 21:09:13 +00:00
Bertrand Simonnet f236bdda07 am 450ed3e8: am eeab5cd5: Merge "metricsd: Remove unused Chrome OS specific files."
* commit '450ed3e8c00a77e40d410311ad698961d3c04537':
  metricsd: Remove unused Chrome OS specific files.
2015-08-12 21:05:09 +00:00
Bertrand Simonnet 833992023c am d26681c0: am 497e38db: Merge "metricsd: Relicense as Apache 2."
* commit 'd26681c02f3d8e6d1115aaff5d72829886237c30':
  metricsd: Relicense as Apache 2.
2015-08-12 21:05:07 +00:00
Yabin Cui 87f73de9e9 am 317acfb8: Merge "Remove confusing variable HOST."
* commit '317acfb88065f68bc3030a5624a63ba4cfaab414':
  Remove confusing variable HOST.
2015-08-12 21:04:54 +00:00
Bertrand Simonnet 450ed3e8c0 am eeab5cd5: Merge "metricsd: Remove unused Chrome OS specific files."
* commit 'eeab5cd585ccaef9d1d0e766bf7c36c661421b9a':
  metricsd: Remove unused Chrome OS specific files.
2015-08-12 20:56:52 +00:00
Bertrand Simonnet d26681c02f am 497e38db: Merge "metricsd: Relicense as Apache 2."
* commit '497e38db9d79e786ffc3916d135c85fc284aeca1':
  metricsd: Relicense as Apache 2.
2015-08-12 20:56:51 +00:00
Yabin Cui 317acfb880 Merge "Remove confusing variable HOST." 2015-08-12 20:55:59 +00:00