Commit Graph

18353 Commits

Author SHA1 Message Date
Yabin Cui 1060739bfe Merge "adb: run reverse_service() in main thread." 2015-11-02 21:34:39 +00:00
Bertrand Simonnet 475baee4e2 Merge "metricsd: Report the model manifest id."
am: 605f2f024b

* commit '605f2f024bd2ec06f613fa25f0a0c55ccde92786':
  metricsd: Report the model manifest id.
2015-11-02 20:59:33 +00:00
Bertrand Simonnet 605f2f024b Merge "metricsd: Report the model manifest id." 2015-11-02 20:53:57 +00:00
Josh Gao 05786779f3 adb: allow multiple args to push/pull.
Bug: http://b/25324823
Change-Id: I369dd97adbe1d08e18e84af776ce8b1d61251835
2015-11-02 12:48:24 -08:00
Daniel Rosenberg 52b5915945 rootdir: Allow board specific folders and symlinks in root directory
Building without ramdisk requires a way to specify board specific
directoryies and symlinks in the root directory at build time.

Change-Id: I11301e98228bc4761f3aee177a546146651b9f25
(cherry picked from commit d7549c9a65cad886f672af41f5fca6f0bd0c12fa)
2015-11-02 12:47:46 -08:00
Casey Dahlin 1d22e94306 Merge "Make Join support string delimiters"
am: 46776e7423

* commit '46776e7423c9a4a7ed5f52def545feee4c31297c':
  Make Join support string delimiters
2015-11-02 20:34:59 +00:00
Casey Dahlin 46776e7423 Merge "Make Join support string delimiters" 2015-11-02 20:28:09 +00:00
Casey Dahlin 5345f1df0d Make Join support string delimiters
We've needed this several times in the past.

Change-Id: I7324e8083fe2ff1aa0bf392a8c124fc2f3bb26e2
Test: Full android build
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-11-02 11:04:34 -08:00
Josh Gao dcaf6932fd Merge "adb: use correct _WIN32 macro."
am: 5c75b529f6

* commit '5c75b529f684b388c91c7e7d0b2c7fece376ac1d':
  adb: use correct _WIN32 macro.
2015-11-02 18:59:01 +00:00
Josh Gao 5c75b529f6 Merge "adb: use correct _WIN32 macro." 2015-11-02 18:55:09 +00:00
Yabin Cui fbfa84045d adb: run reverse_service() in main thread.
reverse_service() calls handle_forward_request(), which calls
functions in fdevent.cpp. fdevent functions is only supposed
to be called in the main thread.
Add check in fdevent.cpp to make sure all operations come from
main thread.

Bug: 25355808
Change-Id: Iceb9273f3056acc0713eaafe086ac950ca80ff4f
2015-11-02 10:39:09 -08:00
Elliott Hughes 1de89478ac Merge "Fix ParseInt/ParseUint to handle explicit "0x" hex."
am: ddf5edacc2

* commit 'ddf5edacc24125730b537265f69a081b19606246':
  Fix ParseInt/ParseUint to handle explicit "0x" hex.
2015-11-02 18:30:59 +00:00
Elliott Hughes ddf5edacc2 Merge "Fix ParseInt/ParseUint to handle explicit "0x" hex." 2015-11-02 18:26:59 +00:00
Elliott Hughes 3ab05869d8 Fix ParseInt/ParseUint to handle explicit "0x" hex.
Also improve fastboot error reporting around max-download-size.

Change-Id: Ic3aec9460de01e5264a2803a0a6be3706d73026b
2015-11-02 09:01:53 -08:00
Daniel Erat 839cadfc9b Merge "libcutils: Make /data/nativetest{,64}/* executable."
am: 00617fbe57

* commit '00617fbe57a6330537a51b81c2e346b934f40d9e':
  libcutils: Make /data/nativetest{,64}/* executable.
2015-11-02 17:01:47 +00:00
Daniel Erat 00617fbe57 Merge "libcutils: Make /data/nativetest{,64}/* executable." 2015-11-02 16:57:56 +00:00
Daniel Erat 5510c13991 libcutils: Make /data/nativetest{,64}/* executable.
Make test files under /data/nativetest{,64} 0750 root:shell
to avoid needing to manually chmod them.

Bug: 25340994
Change-Id: I174cc226195907c0effa99063a8aa0082f85722b
2015-11-02 09:45:04 -07:00
Josh Gao 4a1397264b adb: use correct _WIN32 macro.
Change-Id: I5af7957162ae7f8472a5a262434eaba84e64325a
2015-10-30 18:39:20 -07:00
Elliott Hughes edb78620fb Merge "adb: fix adb client running out of sockets on Windows"
am: 1e2382a027

* commit '1e2382a0277eb36fb57a3a54202945556dfd234b':
  adb: fix adb client running out of sockets on Windows
2015-10-30 23:33:26 +00:00
Elliott Hughes 1e2382a027 Merge "adb: fix adb client running out of sockets on Windows" 2015-10-30 23:29:27 +00:00
Spencer Low 351ecd15b2 adb: fix adb client running out of sockets on Windows
Background
==========

On Windows, if you run "adb shell exit" in a loop in two windows,
eventually the adb client will be unable to connect to the adb server. I
think connect() is returning WSAEADDRINUSE: "Only one usage of each
socket address (protocol/network address/port) is normally permitted.
(10048)". The Windows System Event Log may also show Event 4227, Tcpip.
Netstat output is filled with:

  # for the adb server
  TCP    127.0.0.1:5037         127.0.0.1:65523        TIME_WAIT
  # for the adb client
  TCP    127.0.0.1:65523        127.0.0.1:5037         TIME_WAIT

The error probably means that the client is running out of free
address:port pairs.

The first netstat line is unavoidable, but the second line exists
because the adb client is not waiting for orderly/graceful shutdown of
the socket, and that is apparently required on Windows to get rid of the
second line. For more info, see
https://github.com/CompareAndSwap/SocketCloseTest .

This is exacerbated by the fact that "adb shell exit" makes 4 socket
connections to the adb server: 1) host:version, 2) host:features, 3)
host:version (again), 4) shell:exit. Also exacerbating is the fact that
the adb protocol is length-prefixed so the client typically does not
have to 'read() until zero' which effectively waits for orderly/graceful
shutdown.

The Fix
=======

Introduce a function, ReadOrderlyShutdown(), that should be called in
the adb client to wait for the server to close its socket, before
closing the client socket.

I reviewed all code where the adb client makes a connection to the adb
server and added ReadOrderlyShutdown() when it made sense. I wasn't able
to add it to the following:

* interactive_shell: this doesn't matter because this is interactive and
  thus can't be run fast enough to use up ports.
* adb sideload: I couldn't get enough test coverage and I don't think
  this is being called frequently enough to be a problem.
* send_shell_command, backup, adb_connect_command, adb shell, adb
  exec-out, install_multiple_app, adb_send_emulator_command: These
  already wait for server socket shutdown since they already call
  recv() until zero.
* restore, adb exec-in: protocol design can't have the server close
  first.
* adb start-server: no fd is actually returned
* create_local_service_socket, local_connect_arbitrary_ports,
  connect_device: probably called rarely enough not to be a problem.

Also in this change
===================

* Clarify comments in when adb_shutdown() is called before exit().
* add some missing adb_close() in adb sideload.
* Fixup error handling and comments in adb_send_emulator_command().
* Make SyncConnection::SendQuit return a success boolean.
* Add unittest for adb emu kill command. This gets code coverage over
  this very careful piece of code.

Change-Id: Iad0b1336f5b74186af2cd35f7ea827d0fa77a17c
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-10-30 16:23:10 -07:00
Elliott Hughes 878f0b9c82 Merge "Fix ps -Z so it combines with other arguments."
am: dd48ffe910

* commit 'dd48ffe91003f29e378ef30776cdc4e6091db759':
  Fix ps -Z so it combines with other arguments.
2015-10-30 23:15:29 +00:00
Elliott Hughes dd48ffe910 Merge "Fix ps -Z so it combines with other arguments." 2015-10-30 23:11:18 +00:00
Elliott Hughes 888b517826 Merge "Remove the name filtering from toolbox ps."
am: 9d1636b193

* commit '9d1636b193adf9ba6cd598e3637bbebafcf4f9bf':
  Remove the name filtering from toolbox ps.
2015-10-30 22:25:31 +00:00
Elliott Hughes d2e26c0e30 Fix ps -Z so it combines with other arguments.
This is another step towards being able to swap toolbox ps out for
a more complete ps. This should also let us fix dumpstate to not
need a separate "ps -Z" run --- we can just add -Z to the previous
run of ps instead.

Change-Id: I0b96dff51988edd2b33879f8c31faccebeeffddd
2015-10-30 15:16:45 -07:00
Elliott Hughes 9d1636b193 Merge "Remove the name filtering from toolbox ps." 2015-10-30 22:14:55 +00:00
Elliott Hughes 5dc119a67b Remove the name filtering from toolbox ps.
Regular ps doesn't have this, and at least in our tree everyone
seems to actually pipe to grep instead of using this anyway. But
since the switch to a more full-featured ps is going to be a nightmare
anyway, let's dip a toe in the water by removing something we don't plan
on supporting.

Change-Id: Id220ae0cfdad8368341730f643a2bfbaad3c9716
2015-10-30 15:03:30 -07:00
Mark Salyzyn 14105639a9 Merge "logd: statistics report chatty effective percentage"
am: d2c8cf8265

* commit 'd2c8cf826587de9ef1269ba22fd70df00f874c23':
  logd: statistics report chatty effective percentage
2015-10-30 22:02:15 +00:00
Mark Salyzyn 2c0f84da2e Merge "logd: Add support for *.logd.filter"
am: 95ec339f5e

* commit '95ec339f5ef68696630df470e172bbb306faa1b6':
  logd: Add support for *.logd.filter
2015-10-30 22:02:10 +00:00
Mark Salyzyn d2c8cf8265 Merge "logd: statistics report chatty effective percentage" 2015-10-30 22:00:38 +00:00
Mark Salyzyn 95ec339f5e Merge "logd: Add support for *.logd.filter" 2015-10-30 21:59:25 +00:00
Mark Salyzyn c723df805a logd: statistics report chatty effective percentage
Report the ESTIMATED instantaneous percentage decrease or increase
that an UID has to the logs as a result of the chatty filtration.

Bug: 22855208
Change-Id: If1e77afb81a2739a72b39bc7c57071763c1d64d8
2015-10-30 14:54:17 -07:00
Mark Salyzyn 932f7acc81 logd: Add support for *.logd.filter
- Add device (ro.logd.filter), persistent (persist.logd.filter)
  properties to control the default filters
- Allow logcat -P default to produce expected results
- Allow logcat -P disable to produce expected results

Change-Id: I651cb705373ec1e88a99e4b9086da4f9668a468a
2015-10-30 14:54:17 -07:00
Elliott Hughes 39f7a1f026 Merge "Show transfer progress in adb sync/pull/push."
am: 26352bf1fb

* commit '26352bf1fbbc8efdfdd0ef4d7c008fcbec445f29':
  Show transfer progress in adb sync/pull/push.
2015-10-30 21:48:33 +00:00
Bertrand SIMONNET e6b96d6d19 metricsd: Report the model manifest id.
When the model manifest id is defined in weave, report it.

Bug: 25386505
Test: the model manifest id is uploaded when defined.
Test: If weaved.conf is not defined, metricsd uploads the default value.

Change-Id: Ic895671621fda9ce5cdeacdbdba58aa73a6887fc
2015-10-30 14:42:55 -07:00
Elliott Hughes 5e58724b33 Merge "fastboot shouldn\'t erase non-existent cache partitions."
am: 9ebdf72a54

* commit '9ebdf72a5465b75ab4ce359e11c1ff6c2f3e376a':
  fastboot shouldn't erase non-existent cache partitions.
2015-10-30 21:42:04 +00:00
Elliott Hughes 26352bf1fb Merge "Show transfer progress in adb sync/pull/push." 2015-10-30 21:41:19 +00:00
Elliott Hughes 9ebdf72a54 Merge "fastboot shouldn't erase non-existent cache partitions." 2015-10-30 21:34:47 +00:00
Elliott Hughes b708d16283 Show transfer progress in adb sync/pull/push.
Change-Id: If5439877d060f9bab29cf84be996071cf680c2d4
2015-10-30 14:19:23 -07:00
Elliott Hughes 2fd45a9cea fastboot shouldn't erase non-existent cache partitions.
Check that the cache partition exists before trying to erase it.

Also clean up some of the C string handling and int booleans.

Bug: http://b/25375777
Change-Id: I1880e542b729f2026ab3a2943d4bee9d659b1eeb
2015-10-30 14:15:22 -07:00
Adam Lesinski 35b5a07958 Merge "ZipWriter: archive disk numbers are 0 index based"
am: 25322eeddd

* commit '25322eedddb833d923a3eb8339ef11a1558aecdb':
  ZipWriter: archive disk numbers are 0 index based
2015-10-30 17:00:17 +00:00
Adam Lesinski 42f8538df5 Merge "Add deflate compression to ZipWriter"
am: ac60abdd70

* commit 'ac60abdd703b3900969fc609922593b2a8343f7f':
  Add deflate compression to ZipWriter
2015-10-30 17:00:10 +00:00
Adam Lesinski 25322eeddd Merge "ZipWriter: archive disk numbers are 0 index based" 2015-10-30 16:56:11 +00:00
Adam Lesinski ac60abdd70 Merge "Add deflate compression to ZipWriter" 2015-10-30 16:55:55 +00:00
Sami Tolvanen 12062c04ef Merge "fs_mgr: set partition.*.verified property even without state"
am: b093cda7fb

* commit 'b093cda7fb83f39c6e2f25bda6a82b0c8b332ca2':
  fs_mgr: set partition.*.verified property even without state
2015-10-30 14:56:34 +00:00
Sami Tolvanen b093cda7fb Merge "fs_mgr: set partition.*.verified property even without state" 2015-10-30 14:51:34 +00:00
Sami Tolvanen 25b230c62c fs_mgr: set partition.*.verified property even without state
Set properties on verity_update_state even if verity state management
is not used.

Bug: 24865045
Change-Id: Ic68a9e1a230c959eeb2a769260ff7d8e100cb1e1
(cherry picked from 0eb0516665678aec7712d88b51c96aaf8b312060)
2015-10-30 13:14:38 +00:00
Narayan Kamath dfa10ee4dc Merge "libziparchive: fix calculation of mod_time."
am: b57cd14596

* commit 'b57cd14596ea26d8808b5f193769b0727f5e15e3':
  libziparchive: fix calculation of mod_time.
2015-10-30 10:05:48 +00:00
Narayan Kamath b57cd14596 Merge "libziparchive: fix calculation of mod_time." 2015-10-30 10:03:28 +00:00
beonit 0e99a2f79a libziparchive: fix calculation of mod_time.
Take mod_date into account as well, and fixes the issue where
all entries had creation dates in 1979.

Signed-off-by: beonit <beonit@gmail.com>
Change-Id: Id101794fa08218d15f2d1ba4e4a313c1807ea7aa
2015-10-30 10:01:38 +00:00