OSDN Git Service

android-x86/system-core.git
8 years agoMerge "adb: use correct _WIN32 macro."
Josh Gao [Mon, 2 Nov 2015 18:55:09 +0000 (18:55 +0000)]
Merge "adb: use correct _WIN32 macro."

8 years agoMerge "Fix ParseInt/ParseUint to handle explicit "0x" hex."
Elliott Hughes [Mon, 2 Nov 2015 18:26:59 +0000 (18:26 +0000)]
Merge "Fix ParseInt/ParseUint to handle explicit "0x" hex."

8 years agoFix ParseInt/ParseUint to handle explicit "0x" hex.
Elliott Hughes [Mon, 2 Nov 2015 17:01:53 +0000 (09:01 -0800)]
Fix ParseInt/ParseUint to handle explicit "0x" hex.

Also improve fastboot error reporting around max-download-size.

Change-Id: Ic3aec9460de01e5264a2803a0a6be3706d73026b

8 years agoMerge "libcutils: Make /data/nativetest{,64}/* executable."
Daniel Erat [Mon, 2 Nov 2015 16:57:56 +0000 (16:57 +0000)]
Merge "libcutils: Make /data/nativetest{,64}/* executable."

8 years agolibcutils: Make /data/nativetest{,64}/* executable.
Daniel Erat [Wed, 28 Oct 2015 22:52:37 +0000 (16:52 -0600)]
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

8 years agoadb: use correct _WIN32 macro.
Josh Gao [Sat, 31 Oct 2015 01:38:34 +0000 (18:38 -0700)]
adb: use correct _WIN32 macro.

Change-Id: I5af7957162ae7f8472a5a262434eaba84e64325a

8 years agoMerge "adb: fix adb client running out of sockets on Windows"
Elliott Hughes [Fri, 30 Oct 2015 23:29:27 +0000 (23:29 +0000)]
Merge "adb: fix adb client running out of sockets on Windows"

8 years agoadb: fix adb client running out of sockets on Windows
Spencer Low [Thu, 15 Oct 2015 00:32:44 +0000 (17:32 -0700)]
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>
8 years agoMerge "Fix ps -Z so it combines with other arguments."
Elliott Hughes [Fri, 30 Oct 2015 23:11:18 +0000 (23:11 +0000)]
Merge "Fix ps -Z so it combines with other arguments."

8 years agoFix ps -Z so it combines with other arguments.
Elliott Hughes [Fri, 30 Oct 2015 22:16:45 +0000 (15:16 -0700)]
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

8 years agoMerge "Remove the name filtering from toolbox ps."
Elliott Hughes [Fri, 30 Oct 2015 22:14:55 +0000 (22:14 +0000)]
Merge "Remove the name filtering from toolbox ps."

8 years agoRemove the name filtering from toolbox ps.
Elliott Hughes [Fri, 30 Oct 2015 22:03:30 +0000 (15:03 -0700)]
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

8 years agoMerge "logd: statistics report chatty effective percentage"
Mark Salyzyn [Fri, 30 Oct 2015 22:00:38 +0000 (22:00 +0000)]
Merge "logd: statistics report chatty effective percentage"

8 years agoMerge "logd: Add support for *.logd.filter"
Mark Salyzyn [Fri, 30 Oct 2015 21:59:25 +0000 (21:59 +0000)]
Merge "logd: Add support for *.logd.filter"

8 years agologd: statistics report chatty effective percentage
Mark Salyzyn [Mon, 24 Aug 2015 18:08:00 +0000 (11:08 -0700)]
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

8 years agologd: Add support for *.logd.filter
Mark Salyzyn [Fri, 28 Aug 2015 15:02:59 +0000 (08:02 -0700)]
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

8 years agoMerge "Show transfer progress in adb sync/pull/push."
Elliott Hughes [Fri, 30 Oct 2015 21:41:19 +0000 (21:41 +0000)]
Merge "Show transfer progress in adb sync/pull/push."

8 years agoMerge "fastboot shouldn't erase non-existent cache partitions."
Elliott Hughes [Fri, 30 Oct 2015 21:34:47 +0000 (21:34 +0000)]
Merge "fastboot shouldn't erase non-existent cache partitions."

8 years agoShow transfer progress in adb sync/pull/push.
Elliott Hughes [Tue, 27 Oct 2015 23:03:15 +0000 (16:03 -0700)]
Show transfer progress in adb sync/pull/push.

Change-Id: If5439877d060f9bab29cf84be996071cf680c2d4

8 years agofastboot shouldn't erase non-existent cache partitions.
Elliott Hughes [Fri, 30 Oct 2015 18:49:47 +0000 (11:49 -0700)]
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

8 years agoMerge "ZipWriter: archive disk numbers are 0 index based"
Adam Lesinski [Fri, 30 Oct 2015 16:56:11 +0000 (16:56 +0000)]
Merge "ZipWriter: archive disk numbers are 0 index based"

8 years agoMerge "Add deflate compression to ZipWriter"
Adam Lesinski [Fri, 30 Oct 2015 16:55:55 +0000 (16:55 +0000)]
Merge "Add deflate compression to ZipWriter"

8 years agoMerge "fs_mgr: set partition.*.verified property even without state"
Sami Tolvanen [Fri, 30 Oct 2015 14:51:34 +0000 (14:51 +0000)]
Merge "fs_mgr: set partition.*.verified property even without state"

8 years agofs_mgr: set partition.*.verified property even without state
Sami Tolvanen [Fri, 30 Oct 2015 13:11:00 +0000 (13:11 +0000)]
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)

8 years agoMerge "libziparchive: fix calculation of mod_time."
Narayan Kamath [Fri, 30 Oct 2015 10:03:28 +0000 (10:03 +0000)]
Merge "libziparchive: fix calculation of mod_time."

8 years agolibziparchive: fix calculation of mod_time.
beonit [Fri, 17 Jul 2015 17:08:16 +0000 (02:08 +0900)]
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

8 years agoMerge changes Iefbea3b1,Ieb924b6d
Mark Salyzyn [Thu, 29 Oct 2015 23:00:14 +0000 (23:00 +0000)]
Merge changes Iefbea3b1,Ieb924b6d

* changes:
  liblog: add android_log_timestamp() private function
  liblog: logcat: add epoch and monotonic format modifiers

8 years agoliblog: add android_log_timestamp() private function
Mark Salyzyn [Tue, 8 Sep 2015 15:32:01 +0000 (08:32 -0700)]
liblog: add android_log_timestamp() private function

Change-Id: Iefbea3b1be2f97cfdeb35e5330e5495e0337215b

8 years agoliblog: logcat: add epoch and monotonic format modifiers
Mark Salyzyn [Mon, 31 Aug 2015 22:53:41 +0000 (15:53 -0700)]
liblog: logcat: add epoch and monotonic format modifiers

- '-v epoch' prints seconds since Jan 1 1970
- '-v monotonic' print cpu seconds since start of device
- '-T sssss.mmm...' as alternate tail time format

NB: monotonic is a best estimate and may be out by a few ms
    given the synchronization source clue accuracy.

Bug: 23668800
Change-Id: Ieb924b6d3817669c7e53beb9c970fb626eaad460

8 years agoMerge "Use GetBuildTime from libchrome instead of __DATE__"
Dan Willemsen [Thu, 29 Oct 2015 20:53:38 +0000 (20:53 +0000)]
Merge "Use GetBuildTime from libchrome instead of __DATE__"

8 years agoUse GetBuildTime from libchrome instead of __DATE__
Dan Willemsen [Thu, 29 Oct 2015 20:00:31 +0000 (13:00 -0700)]
Use GetBuildTime from libchrome instead of __DATE__

So that this daemon doesn't change on every build, use the system build
date from libchrome (which reads ro.build.date). That way we don't have
to update this daemon for every OTA.

Bug: 24204119
Change-Id: I136d53e5e4ebb9430a57dace66198d8d704d7ca3

8 years agoMerge "Don't use VLAs in adb."
Elliott Hughes [Tue, 27 Oct 2015 22:47:05 +0000 (22:47 +0000)]
Merge "Don't use VLAs in adb."

8 years agoMerge "core: Rename libchromeos into libbrillo"
Alex Vakulenko [Tue, 27 Oct 2015 22:46:51 +0000 (22:46 +0000)]
Merge "core: Rename libchromeos into libbrillo"

8 years agoDon't use VLAs in adb.
Elliott Hughes [Tue, 27 Oct 2015 20:40:35 +0000 (13:40 -0700)]
Don't use VLAs in adb.

This makes no measurable difference to the sync time; "adb sync" of
everything on /system for a Nexus 9 still takes 20s.

Change-Id: Ifa2626f7453937e43856b9c4ee06e1f5db0aa273

8 years agoMerge "crash_reporter: Make report log more useful"
Steve Fung [Tue, 27 Oct 2015 22:18:59 +0000 (22:18 +0000)]
Merge "crash_reporter: Make report log more useful"

8 years agoMerge "crash_sender: Properly handle curl errors"
Steve Fung [Tue, 27 Oct 2015 21:56:06 +0000 (21:56 +0000)]
Merge "crash_sender: Properly handle curl errors"

8 years agocrash_reporter: Make report log more useful
Steve Fung [Tue, 20 Oct 2015 22:37:31 +0000 (15:37 -0700)]
crash_reporter: Make report log more useful

Convert the crash reporter upload log to be json objects.
Report the product_id in the crash report upload log.  Also add
the exec name to the log to make it easier finding specific
crash reports if multiple binaries are crashing.

Bug: 25121166
Change-Id: I48ad88fcb0bb00b4a21dc6f2aa54f94cead971ea

8 years agocrash_sender: Properly handle curl errors
Steve Fung [Tue, 27 Oct 2015 21:24:43 +0000 (14:24 -0700)]
crash_sender: Properly handle curl errors

When the crash server returns an error code, correctly handle
it as a curl error.

Bug: 25295034
Change-Id: I75986a099cfcf90e5d7f2e9acf5616a164b5fc36

8 years agocore: Rename libchromeos into libbrillo
Alex Vakulenko [Tue, 27 Oct 2015 18:46:37 +0000 (11:46 -0700)]
core: Rename libchromeos into libbrillo

BUG: 24872993
Change-Id: Ia47ad51140f7e384822eea9d5de46c9f51ceda11

8 years agoMerge "adb: fix -Tt options to match ssh."
David Pursell [Tue, 27 Oct 2015 15:39:33 +0000 (15:39 +0000)]
Merge "adb: fix -Tt options to match ssh."

8 years agoadb: fix -Tt options to match ssh.
David Pursell [Tue, 20 Oct 2015 21:19:36 +0000 (14:19 -0700)]
adb: fix -Tt options to match ssh.

ssh has slightly more sophisticated -Tt options that we want to match.
This CL changes -Tt behavior to match ssh so that we allocate a remote
PTY in these cases:
     -T: never.
       : if stdin is a terminal and user wants an interactive shell.
     -t: if stdin is a terminal (otherwise print a warning message).
  -t -t: always.

Now this will work as expected:
  $ adb shell < my_script.sh

Also corrects a small unrelated bug with escape sequences so that only
a single tilde is accepted for the disconnect sequence.

Bug: http://b/24565284
Change-Id: Idab57ac98d81233b45c2613fe64ceb4398add961

8 years agoMerge "Fix adb sync/pull/push error reporting."
Elliott Hughes [Mon, 26 Oct 2015 16:30:46 +0000 (16:30 +0000)]
Merge "Fix adb sync/pull/push error reporting."

8 years agoFix adb sync/pull/push error reporting.
Elliott Hughes [Sat, 24 Oct 2015 04:06:11 +0000 (21:06 -0700)]
Fix adb sync/pull/push error reporting.

I fixed the server side to send detailed error reports, but the client-side
code for pull was broken because it had already read the "FAIL" header before
calling the general error reporting code that expects to be able to read
the header. This meant we'd always report that we failed to read the failure
message.

Also add a couple of missing "\n"s, make sure every error message is prefixed
by "adb: ", and remove a useless path length check that would silently ignore
over-long paths rather than relying on SendRequest to detect and report the
problem.

Bug: http://b/6205106
Change-Id: I23862ececf03b761115ffa3f7725b7e1cecb48c7

8 years agoMerge "adb: Mask SIGTTIN so that I/O works when backgrounded."
Josh Gao [Sat, 24 Oct 2015 01:32:06 +0000 (01:32 +0000)]
Merge "adb: Mask SIGTTIN so that I/O works when backgrounded."

8 years agoadb: Mask SIGTTIN so that I/O works when backgrounded.
Josh Gao [Fri, 23 Oct 2015 22:03:31 +0000 (15:03 -0700)]
adb: Mask SIGTTIN so that I/O works when backgrounded.

SIGTTIN gets sent to the process when we attempt to read from
stdin when we're in the background, which stops the process by
default. Mask the signal so that the read returns -1 with errno
set to EIO, instead.

Change-Id: I4ae626b0670c05a1a05165539b9eed709e83d536

8 years agoMerge "Disable container overflow detect on target."
Evgenii Stepanov [Fri, 23 Oct 2015 22:03:52 +0000 (22:03 +0000)]
Merge "Disable container overflow detect on target."

8 years agoDisable container overflow detect on target.
Evgenii Stepanov [Fri, 23 Oct 2015 21:49:16 +0000 (14:49 -0700)]
Disable container overflow detect on target.

Container overflow annotations may cause false positives in partially
instrumented binaries.

Bug: 2522812525212198
Change-Id: Ic587d41698c02e306dece4ad7c6a2a8810c52dbd

8 years agoMerge "Lose df to toybox."
Elliott Hughes [Fri, 23 Oct 2015 19:19:15 +0000 (19:19 +0000)]
Merge "Lose df to toybox."

8 years agoLose df to toybox.
Elliott Hughes [Fri, 23 Oct 2015 18:09:53 +0000 (11:09 -0700)]
Lose df to toybox.

Change-Id: I4c8e6c1071779914969cc7f5a80fe6248b508405

8 years agoMerge "Don't use libstdc++."
Dan Albert [Fri, 23 Oct 2015 15:47:37 +0000 (15:47 +0000)]
Merge "Don't use libstdc++."

8 years agoDon't use libstdc++.
Dan Albert [Fri, 23 Oct 2015 15:46:20 +0000 (08:46 -0700)]
Don't use libstdc++.

No one should be using libstdc++. All the cool projects use libc++.

Change-Id: Ifa357f0dcaba0b57e1af583baf2e40332c2b58d9

8 years agoMerge "system/core: add libpackagelistparser"
Andreas Gampe [Fri, 23 Oct 2015 03:46:41 +0000 (03:46 +0000)]
Merge "system/core: add libpackagelistparser"

8 years agoMerge "Logd: Fix missing include of rc file"
Andreas Gampe [Fri, 23 Oct 2015 03:46:16 +0000 (03:46 +0000)]
Merge "Logd: Fix missing include of rc file"

8 years agoLogd: Fix missing include of rc file
Andreas Gampe [Fri, 23 Oct 2015 03:36:53 +0000 (20:36 -0700)]
Logd: Fix missing include of rc file

This went missing in commit aeca97ba1cb6fdc028dd2f1f984eebb40c85b1fc.

Change-Id: I9d7e48a2ffb1649f3fa515a9d12d5fbdd2ed58b7

8 years agosystem/core: add libpackagelistparser
Andreas Gampe [Fri, 23 Oct 2015 02:51:51 +0000 (19:51 -0700)]
system/core: add libpackagelistparser

There are 4 components that all implement package parsing, they are:
1. sdcardd
2. libselinux
3. logd
4. runas

Create a library that can be used by all of them, and new ones as needed.

(Moved from frameworks/base)

Change-Id: I282ec1204e592502ef3b28fedf577af824338c58

8 years agoMerge "init/adb: correct static lib dependencies for libselinux"
Daniel Cashman [Thu, 22 Oct 2015 23:03:51 +0000 (23:03 +0000)]
Merge "init/adb: correct static lib dependencies for libselinux"

8 years agoMerge "sdcard: use libpackageparser"
Daniel Cashman [Thu, 22 Oct 2015 23:03:51 +0000 (23:03 +0000)]
Merge "sdcard: use libpackageparser"

8 years agoMerge "logd: use libpackageparser"
Daniel Cashman [Thu, 22 Oct 2015 23:03:51 +0000 (23:03 +0000)]
Merge "logd: use libpackageparser"

8 years agosdcard: use libpackageparser
William Roberts [Fri, 31 Jul 2015 20:11:19 +0000 (13:11 -0700)]
sdcard: use libpackageparser

Switch from the internal packages.list file parser
implementation to a common parser library.

See Change-Id: I87a406802f95d8e7bfd8ee85f723f80e9e6b6c0c
for all of the details.

Change-Id: I98924dce406b322e0d402bca7fdac51f6a1e6a4b
Signed-off-by: William Roberts <william.c.roberts@intel.com>
8 years agoinit/adb: correct static lib dependencies for libselinux
William Roberts [Tue, 4 Aug 2015 21:23:04 +0000 (14:23 -0700)]
init/adb: correct static lib dependencies for libselinux

Now that libselinux uses libpackagelistparser, in order
for libpackagelistparser to be properly statically linked
liblog must come after libselinux for all the liblog
references to be defined in libpackagelistparser which
is included in libselinux. This patch corrects that order.

Change-Id: I7aee10c9395310919779ed2463aab6b2f8b380cc
Signed-off-by: William Roberts <william.c.roberts@intel.com>
8 years agoMerge "Fix some compiler warnings in libpixelflinger."
Elliott Hughes [Thu, 22 Oct 2015 22:11:29 +0000 (22:11 +0000)]
Merge "Fix some compiler warnings in libpixelflinger."

8 years agoMerge "Remove __DATE__/__TIME__ from init and debuggerd"
Dan Willemsen [Thu, 22 Oct 2015 21:58:05 +0000 (21:58 +0000)]
Merge "Remove __DATE__/__TIME__ from init and debuggerd"

8 years agoRemove __DATE__/__TIME__ from init and debuggerd
Dan Willemsen [Thu, 22 Oct 2015 20:04:22 +0000 (13:04 -0700)]
Remove __DATE__/__TIME__ from init and debuggerd

Keeping these means that every build has different init and debuggerd
binaries, even if the source was the same. So OTAs that don't touch
these sources would still need to update the binaries.

Both of these messages are only informational, so can be safely removed.
Bootchart already encodes build-specific information from the system
properties.

Bug: 24204119
Change-Id: I7ebd65a20a3e031e7528c9f741616e20b3cd7446

8 years agoMerge "Disable sanitization for LinearTransform"
Andy Hung [Thu, 22 Oct 2015 19:43:23 +0000 (19:43 +0000)]
Merge "Disable sanitization for LinearTransform"

8 years agoDisable sanitization for LinearTransform
Andy Hung [Wed, 21 Oct 2015 22:11:02 +0000 (15:11 -0700)]
Disable sanitization for LinearTransform

Avoids potential crash on Fugu.

Bug: 25160007
Change-Id: I2e883539e36204821f3eb97f0ae4a4854014f048

8 years agoFix some compiler warnings in libpixelflinger.
Elliott Hughes [Thu, 22 Oct 2015 01:52:17 +0000 (18:52 -0700)]
Fix some compiler warnings in libpixelflinger.

class/struct mismatch and use of 'register'.

Change-Id: I6cfe0f7fdc214c3a009eb01251f5ea9a8fdb895d

8 years agoMerge "Fix parameter to lseek"
Elliott Hughes [Tue, 20 Oct 2015 21:36:49 +0000 (21:36 +0000)]
Merge "Fix parameter to lseek"

8 years agoFix parameter to lseek
caozhiyuan [Tue, 20 Oct 2015 06:28:52 +0000 (14:28 +0800)]
Fix parameter to lseek

Change-Id: I9c497a3ebc24ca1db92d0b9d3d1e9ac49dc40f75

8 years agoMerge "Fix lseek argument order."
Elliott Hughes [Tue, 20 Oct 2015 20:28:05 +0000 (20:28 +0000)]
Merge "Fix lseek argument order."

8 years agoFix lseek argument order.
Elliott Hughes [Tue, 20 Oct 2015 20:18:22 +0000 (13:18 -0700)]
Fix lseek argument order.

Change-Id: I12feed2de8a4e0782f90609254a3e2ec66d7d98e

8 years agoZipWriter: archive disk numbers are 0 index based
Adam Lesinski [Tue, 20 Oct 2015 19:41:49 +0000 (12:41 -0700)]
ZipWriter: archive disk numbers are 0 index based

Misunderstood that disk numbers were 1 index based.

Change-Id: I0c1f43436f1c5e9394818ad12164f6d7b982cbd8

8 years agoAdd deflate compression to ZipWriter
Adam Lesinski [Tue, 6 Oct 2015 22:23:46 +0000 (15:23 -0700)]
Add deflate compression to ZipWriter

Use zlib to deflate compress data into the zip file.

Change-Id: If094b926a67e199be976c3190781cd0101dd66e1

8 years agoMerge "crash_reporter: add missing mkdir for crash_server rule"
Mike Frysinger [Tue, 20 Oct 2015 18:59:35 +0000 (18:59 +0000)]
Merge "crash_reporter: add missing mkdir for crash_server rule"

8 years agocrash_reporter: add missing mkdir for crash_server rule
Mike Frysinger [Tue, 20 Oct 2015 18:09:23 +0000 (14:09 -0400)]
crash_reporter: add missing mkdir for crash_server rule

When doing a clean build, creating this file fails because the dir does
not yet exist:
echo "" > out/target/product/brilloemulator_arm/obj/ETC/crash_server_intermediates/crash_server
/bin/bash: out/target/product/brilloemulator_arm/obj/ETC/crash_server_intermediates/crash_server: No such file or directory

Bug: 24989289
Change-Id: If204dc0eb32e95ee66f97b568b4b9ae4050d3591

8 years agoMerge "adb: use libfec in disable-verity"
Sami Tolvanen [Tue, 20 Oct 2015 14:34:29 +0000 (14:34 +0000)]
Merge "adb: use libfec in disable-verity"

8 years agoadb: use libfec in disable-verity
Sami Tolvanen [Tue, 20 Oct 2015 12:24:24 +0000 (13:24 +0100)]
adb: use libfec in disable-verity

Use libfec to locate verity metadata and disable verity.

Needs changes from
  I02f83b0d1d4e7ef5cd5d13a37ff0b84f17e23376

Bug: 21893453
Change-Id: Ib43c352400a368664c949c7b8c9961829adf48f4

8 years agoMerge "adb: win32: Improve Winsock error code mappings and strings"
Elliott Hughes [Mon, 19 Oct 2015 18:52:59 +0000 (18:52 +0000)]
Merge "adb: win32: Improve Winsock error code mappings and strings"

8 years agoadb: win32: Improve Winsock error code mappings and strings
Spencer Low [Sun, 18 Oct 2015 23:45:09 +0000 (16:45 -0700)]
adb: win32: Improve Winsock error code mappings and strings

Improved mapping of Winsock error codes to POSIX error codes, especially
WSAECONNABORTED to EPIPE (which WriteFdExactly() looks for) when sending
to a closed socket and WSAECONNRESET to ECONNRESET when the peer resets
the connection.

Use a macro to map strerror() to adb_strerror() which handles these
POSIX error codes that the Windows C Runtime doesn't recognize.

Also:

* Unittest for adb_strerror().

* Don't trace when send() returns WSAEWOULDBLOCK because that is
  expected.

Change-Id: If46aeb7b36de3eebfbbccf5478ff5b1bb087714b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
8 years agoMerge "libbinderwrapper: Add GetCallingUid() and GetCallingPid()."
Daniel Erat [Fri, 16 Oct 2015 21:43:36 +0000 (21:43 +0000)]
Merge "libbinderwrapper: Add GetCallingUid() and GetCallingPid()."

8 years agoMerge "fix misuse of formatting specifiers"
Elliott Hughes [Fri, 16 Oct 2015 21:28:36 +0000 (21:28 +0000)]
Merge "fix misuse of formatting specifiers"

8 years agoMerge "crash_reporter: Use os-release.d to store the crash server url"
Steve Fung [Fri, 16 Oct 2015 17:16:10 +0000 (17:16 +0000)]
Merge "crash_reporter: Use os-release.d to store the crash server url"

8 years agoMerge "Implement ZipWriter for quickly writing ZipFiles."
Adam Lesinski [Fri, 16 Oct 2015 17:02:19 +0000 (17:02 +0000)]
Merge "Implement ZipWriter for quickly writing ZipFiles."

8 years agolibbinderwrapper: Add GetCallingUid() and GetCallingPid().
Daniel Erat [Fri, 16 Oct 2015 15:04:33 +0000 (09:04 -0600)]
libbinderwrapper: Add GetCallingUid() and GetCallingPid().

Add methods to BinderWrapper for getting the caller's UID
and PID while in a transaction.

Bug: 24988639
Change-Id: Ibd711fc6b3d83623d4bb1060838c65aaef30d76e

8 years agocrash_reporter: Use os-release.d to store the crash server url
Steve Fung [Fri, 16 Oct 2015 09:17:53 +0000 (02:17 -0700)]
crash_reporter: Use os-release.d to store the crash server url

Since all of the other configs use os-release.d rather than
system properties, switch the crash server url as well.  This also
makes the product configuration more straightforward.

Bug: 24989289
Change-Id: Ia4b423e59937a917c882e74b110b5ea520ca6016

8 years agoMerge "Error correction: Use libfec in fs_mgr"
Sami Tolvanen [Fri, 16 Oct 2015 05:48:39 +0000 (05:48 +0000)]
Merge "Error correction: Use libfec in fs_mgr"

8 years agoImplement ZipWriter for quickly writing ZipFiles.
Adam Lesinski [Tue, 6 Oct 2015 01:16:18 +0000 (18:16 -0700)]
Implement ZipWriter for quickly writing ZipFiles.

The ZipWriter implementation exposes a stateful interface that allows
bytes of data to be streamed in as they arrive. ZipEntries can be
compressed and/or aligned on a 32-bit boundary for mmapping at runtime.

Change-Id: I43ac9e661aa5022f00d9e12b247c4314d61c441c

8 years agoMerge "adb: non-interactive shell stdin."
David Pursell [Thu, 15 Oct 2015 21:37:02 +0000 (21:37 +0000)]
Merge "adb: non-interactive shell stdin."

8 years agoadb: non-interactive shell stdin.
David Pursell [Tue, 6 Oct 2015 22:30:03 +0000 (15:30 -0700)]
adb: non-interactive shell stdin.

Non-interactive `adb shell` previously only read from the remote shell,
but we want it to write as well so interactive and non-interactive
shells can both send data. With this CL, we can now do:
  $ echo foo | adb shell cat
  foo

This is primarily usable with newer devices that support the shell_v2
features. Older devices will receive stdin but the shell will still
hang after all input has been sent, requiring user Ctrl+C. This seems
better than closing communication altogether which could potentially
miss an unpredictable amount of return data by closing too early.

Known issue: non-interactive stdin to a PTY shell isn't reliable.
However I don't think this is a common case as ssh doesn't seem to
handle it properly either. Examples:
  * echo 'echo foo' | adb shell
  * echo 'foo' | adb shell -t cat

Bug: http://b/24565284
Change-Id: I5b017fd12d8478765bb6e8400ea76d535c24ce42

8 years agoMerge "Update crash_reporter and metrics rc files to trigger on post-fs-data"
Steve Fung [Thu, 15 Oct 2015 03:59:33 +0000 (03:59 +0000)]
Merge "Update crash_reporter and metrics rc files to trigger on post-fs-data"

8 years agologd: use libpackageparser
William Roberts [Fri, 31 Jul 2015 20:10:36 +0000 (13:10 -0700)]
logd: use libpackageparser

Switch from the internal packages.list file parser
implementation to a common parser library.

Change-Id: I87a406802f95d8e7bfd8ee85f723f80e9e6b6c0c
Signed-off-by: William Roberts <william.c.roberts@intel.com>
8 years agoUpdate crash_reporter and metrics rc files to trigger on post-fs-data
Steve Fung [Wed, 14 Oct 2015 23:23:03 +0000 (16:23 -0700)]
Update crash_reporter and metrics rc files to trigger on post-fs-data

The /data directory isn't guaranteed to be mounted during the
"on boot" trigger, so switch them to using "on post-fs-data".

Bug: 24941965
Change-Id: Iee84ca0e934967cff7bc4d968d9939d398c73980

8 years agoMerge "metricsd: Read build time values from etc/os-release.d."
Bertrand Simonnet [Thu, 15 Oct 2015 00:33:01 +0000 (00:33 +0000)]
Merge "metricsd: Read build time values from etc/os-release.d."

8 years agometricsd: Read build time values from etc/os-release.d.
Bertrand SIMONNET [Wed, 14 Oct 2015 20:26:42 +0000 (13:26 -0700)]
metricsd: Read build time values from etc/os-release.d.

This stops relying on system properties to provide build time
configuration.
Product version and id will be stored in /etc/os-release.d.
Channel will be pulled from update engine.

BUG: 24947119
Change-Id: I0972d03cd83ef622846de3cce3dec1992fcc46cd

8 years agoMerge "crash_reporter: Update to use the os-release.d configs"
Steve Fung [Wed, 14 Oct 2015 22:48:25 +0000 (22:48 +0000)]
Merge "crash_reporter: Update to use the os-release.d configs"

8 years agoError correction: Use libfec in fs_mgr
Sami Tolvanen [Fri, 22 May 2015 14:43:50 +0000 (15:43 +0100)]
Error correction: Use libfec in fs_mgr

Use libfec to read and parse verity metadata to protect against data
corruption.

Bug: 21893453
Change-Id: I3a3543e0d999316707302b3be8735a7133d22946

8 years agoMerge "Make allocations use unique_ptr."
Christopher Ferris [Wed, 14 Oct 2015 21:10:05 +0000 (21:10 +0000)]
Merge "Make allocations use unique_ptr."

8 years agoMake allocations use unique_ptr.
Christopher Ferris [Wed, 14 Oct 2015 20:20:10 +0000 (13:20 -0700)]
Make allocations use unique_ptr.

Change-Id: I4b84b8106faeaeb61847f8f9d13fd6444f474efd

8 years agoMerge "Revert "Error correction: Use libfec in fs_mgr""
Sami Tolvanen [Wed, 14 Oct 2015 19:47:59 +0000 (19:47 +0000)]
Merge "Revert "Error correction: Use libfec in fs_mgr""

8 years agoRevert "Error correction: Use libfec in fs_mgr"
Sami Tolvanen [Wed, 14 Oct 2015 19:46:16 +0000 (19:46 +0000)]
Revert "Error correction: Use libfec in fs_mgr"

This reverts commit 3de3a0f351ee07cbd31db56d49cef3fbeb7e633b.

Change-Id: I1f121cbc4431b8d8ff146eab29832a8dda1eb8ba

8 years agoMerge "adbd: Add os descriptor support for adb."
Badhri Jagan Sridharan [Wed, 14 Oct 2015 17:28:53 +0000 (17:28 +0000)]
Merge "adbd: Add os descriptor support for adb."