Commit graph

18417 commits

Author SHA1 Message Date
Gilad Arnold
1bc7888104 Fix permissions for /data/nativetest{,64}/tests.txt.
This is not an executable so we have to specifically set its permissions
accordingly.

Bug: 25668833
Change-Id: I502f69bad75b4da4fdc29eb3ebaa42a19ae04d27
2015-11-14 18:25:31 -08:00
David Pursell
44c58471e4 Merge "Revert "fastboot: create Transport object."" 2015-11-14 00:18:43 +00:00
David Pursell
c0504e1873 Revert "fastboot: create Transport object."
This broke some stuff, will look into it Monday.

This reverts commit 6f233a7799.

Change-Id: I155bc85d21fda3b0ba1e5e17839059797fb15509
2015-11-14 00:15:57 +00:00
Josh Gao
29843cf141 Merge "adb: don't pull symlinks." 2015-11-13 23:22:47 +00:00
Josh Gao
f96dc73b9f adb: don't pull symlinks.
Pulling symlinks was broken for directories, and it doesn't seem like
there's a good way to make it not broken, given that the protocol doesn't
have readlink (and we don't want to create symlinks on Windows, anyway).
The behavior for files doesn't seem to be especially useful, either.

Bug: http://b/25601283
Change-Id: Ie1d27e93dd09cbc0c178623b390041d1cb11f726
2015-11-13 15:17:02 -08:00
David Pursell
f131772a79 Merge "fastboot: create Transport object." 2015-11-13 22:49:08 +00:00
Daniel Rosenberg
ce24abe261 Merge "Fix fastboot to not add '-' before suffix" 2015-11-13 21:24:39 +00:00
Daniel Rosenberg
996ecd8b7d Fix fastboot to not add '-' before suffix
Change-Id: I9351b385412151498f47ab46a2620f21b9ac38b8
2015-11-13 12:56:19 -08:00
Elliott Hughes
82a2b2441c Merge "Improve adb help text and adb backup error reporting." 2015-11-13 20:25:11 +00:00
Elliott Hughes
4386b890a7 Merge "Improve top(1) compatibility and interactive usefulness." 2015-11-13 19:28:57 +00:00
Mark Salyzyn
c6f3b96bd8 Merge "logd: klogd: parse error" 2015-11-13 19:22:10 +00:00
David Pursell
6f233a7799 fastboot: create Transport object.
This CL creates a Transport object to provide a generic interface for
various transports. Specifically this is designed to be able to add UDP
support to fastboot in an upcoming CL without changing the main program
logic.

Also includes some minor code style fixes and replaces malloc/free
in the USB implementation files with smart pointers and std::string.

Bug: http://b/22029765
Change-Id: I68641af0da7d13db4647f5e20a18d04d67f0b327
2015-11-13 11:08:17 -08:00
Elliott Hughes
56e6813e27 Improve adb help text and adb backup error reporting.
Bug: https://code.google.com/p/android/issues/detail?id=188220
Bug: http://b/25677893
Change-Id: If174049e86d65d95db93a6e071c089dcd1d7cd4f
2015-11-13 11:04:10 -08:00
Ruchi Kandoi
ab75edb4ad Merge "healthd: Support new PD and USB Type C types" 2015-11-13 17:36:07 +00:00
Elliott Hughes
76aefd5f9b Merge "adb: win32: Unicode USB device names" 2015-11-13 16:41:31 +00:00
Elliott Hughes
d7bd5759d2 Improve top(1) compatibility and interactive usefulness.
The toolbox -t option is really the standard -H option. Add -H so
I can switch dumpstate over.

We should also flush after each run so we don't arbitrarily truncate
at the stdio buffer size. (I'm pretty sure no one uses toolbox top
interactively, but it annoyed me while testing -H.)

Change-Id: Ib87cb541d1b21c48468614b2ef60b0cc62694c95
2015-11-13 08:30:12 -08:00
Mark Salyzyn
eb29808615 logd: klogd: parse error
Resolve three areas missing taglen checking. Add some additional
limit-checking paranoia. Problem started when p was allowed to
go beyond the size of the incoming buffer in some blind
p = cp + 1 fragments, placed the check for that after them all
before harm could be done, rather than in each location.

Bug: 25620123
Change-Id: Ib5687fd30ef0cd3ba3bc0df310b436ad675ccabc
2015-11-13 07:58:05 -08:00
Mark Salyzyn
5559f1d6e8 Merge "liblog: resolve deadlocks" 2015-11-13 15:16:49 +00:00
Spencer Low
bb2900098a adb: win32: Unicode USB device names
Cleanup TODO and instead of (poorly) converting the device name from
wchar_t to char, just retrieve and store it as wchar_t, simplifying the
code.

This probably isn't necessary since device names are probably always
ASCII, but this cleans things up.

Change-Id: Ib780dcdc1e0e06b97b61e25d29a23874b35d7800
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-12 20:13:21 -08:00
Elliott Hughes
61a560aeb1 Merge "adb: win32: remove widen()/narrow() in favor of UTF8ToWide()/WideToUTF8()" 2015-11-13 03:05:02 +00:00
Benson Leung
8a4eef60e1 healthd: Support new PD and USB Type C types
See the new types added here :
https://chromium-review.googlesource.com/304660
Add support for these.

Signed-off-by: Benson Leung <bleung@google.com>

Change-Id: I12c51e0611692a763a7f1cda57c77ad83d7aa7ea
2015-11-12 18:12:43 -08:00
Spencer Low
d21dc825bb adb: win32: remove widen()/narrow() in favor of UTF8ToWide()/WideToUTF8()
Now that we have a more standardized API (also available in Chromium),
switch to it. Another benefit is real error handling instead of just
killing the process on invalid Unicode.

Make UTF8ToWide()/WideToUTF8() set errno to EILSEQ on bad input. This is
the same error code that wcsrtombs(3) uses.

Update the unittest to check for EILSEQ.

Change-Id: Ie92acf74d37adaea116cf610c1bf8cd433741e16
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-12 17:13:08 -08:00
Gilad Arnold
5d75c9d9c2 Merge "Sane ownership/permissions for directories in /data/nativetest{,64}." 2015-11-13 00:56:59 +00:00
Mark Salyzyn
7a2a307192 liblog: resolve deadlocks
Although ever present, an increased regression introduced with
commit b6bee33182 (liblog: logd:
support logd.timestamp = monotonic).

A signal handler can interrupt in locked context, if log is written
in the signal handler, we are in deadlock. Block signals while we
are locked. Separate out timestamp lock from is loggable lock to
reduce contention situations. Provide a best-guess response if
lock would fail in timestamp path.

Bug: 25563384
Change-Id: I6dccd6b99ebace1c473c03a785a35c63ed5c6a8a
2015-11-12 15:39:04 -08:00
Daniel Rosenberg
8336a96c9c Merge changes I8fb6b513,I6dd16245,I0c2753e2
* changes:
  Update fastboot help command with long options
  Changed set_active to be a flag
  Fix fastboot variable name
2015-11-12 23:22:00 +00:00
Bertrand Simonnet
87d2486777 Merge "metricsd: Fix the update channel parsing logic." 2015-11-12 22:55:24 +00:00
Josh Gao
26f2e1fd4f Merge changes Ic124ecb9,I94de55d2
* changes:
  libbase: remove exit-time destructors.
  adb: remove exit-time destructors.
2015-11-12 22:50:03 +00:00
Gilad Arnold
47af47f4c1 Sane ownership/permissions for directories in /data/nativetest{,64}.
This makes native test directories 750 root:shell. This matches the
value for files within those directories, and results in a more usable
access paradigm when (say) unprivileged test tools need to discover
these test binaries.

Bug: 25668833
Change-Id: I9bd2081b2c211b4383b5873238aaf64597756714
2015-11-12 14:34:57 -08:00
Bertrand SIMONNET
dc225c8224 metricsd: Fix the update channel parsing logic.
libupdate_engine_client returns the channel as "stable-channel",
"dev-channel" or "beta-channel". This CL updates the parsing logic to
match this format.

Bug: 25669566
Test: unit tests
Test: manual: The reported channel matches what update_engine_client
  --show_channel reports.

Change-Id: Ic6e52df892ae0b438f58fc05b178d5844d6674d0
2015-11-12 14:08:57 -08:00
Josh Gao
8591f719d0 Merge "adb: properly handle path separators on Windows." 2015-11-12 21:25:00 +00:00
Steve Fung
d36829a734 Merge "crash_reporter: Join AID_READPROC group" 2015-11-12 20:22:10 +00:00
Josh Gao
7df6b5fc79 libbase: remove exit-time destructors.
Removed for the same reason as the adb exit-time destructors.

Bug: http://b/23384853
Change-Id: Ic124ecb9df132b850a3855e207baffec926dde29
2015-11-12 11:54:47 -08:00
Josh Gao
b7b1edf974 adb: remove exit-time destructors.
On exit, these destructors get invoked while other threads might
still be using them, potentially causing a crash, and definitely
causing tsan to report a race condition.

Bug: http://b/23384853
Change-Id: I94de55d22f97f4edd1d7cc1f34e8c1f8dfd56a5a
2015-11-12 11:20:19 -08:00
Bertrand Simonnet
ee50a72d31 Merge "metricsd: Fix logging initialization." 2015-11-12 17:21:39 +00:00
Elliott Hughes
8ce943b3f6 Merge "Cope with angler's whitespace-padded partition size reporting." 2015-11-12 15:38:58 +00:00
Elliott Hughes
a2db2618ec Cope with angler's whitespace-padded partition size reporting.
Before:

  $ fastboot -w
  wiping userdata...
  Couldn't parse partition size '0x        0x66257ee00'.
  wiping cache...
  Couldn't parse partition size '0x        0x6400000'.
  erasing 'userdata'...

Bug: http://b/25653580
Change-Id: I301b8410689c1e52681796c240a149d270360edf
2015-11-12 07:28:39 -08:00
Daniel Rosenberg
7aa38bc54c Update fastboot help command with long options
Change-Id: I8fb6b5139f81893b324202d4c68f29393213ee6f
2015-11-11 20:27:56 -08:00
Daniel Rosenberg
0d08856416 Changed set_active to be a flag
set_active must be able to accept flag like arguments

Change-Id: I6dd162453835d2d64fd8d877f2a7b98e8dd8a907
2015-11-11 20:27:50 -08:00
Daniel Rosenberg
a797479bd5 Fix fastboot variable name
Change-Id: I0c2753e2b79d715f227ee314c071ce68d91779b3
2015-11-11 20:27:43 -08:00
Elliott Hughes
dcb8b288ca Merge "Revert "Revert "adb/base: fix adb push of Unicode filenames on Win32""" 2015-11-12 02:30:08 +00:00
Elliott Hughes
c1fd492ac5 Revert "Revert "adb/base: fix adb push of Unicode filenames on Win32""
This reverts commit cc8cd59456.

With the dependency on libcutils (for gettid for non-bionic) removed,
this no longer breaks the build.

Change-Id: I645bd6876e2502ddc1535b69af1e645c0df9d178
2015-11-11 18:23:00 -08:00
Steve Fung
a76ba85783 crash_reporter: Join AID_READPROC group
Access to /proc files are limited to processes with group
permissions for AID_READPROC, so add that group to the list
of supplemental groups that the user_collector joins.

Bug: 25598241
Change-Id: I26c77b052229346a3ac7150f38e03294f3641f96
2015-11-11 17:50:37 -08:00
Elliott Hughes
524716889b Merge "adb: win32: fix adb shell" 2015-11-12 01:13:54 +00:00
Spencer Low
32762f4afd adb: win32: fix adb shell
28416d6d33 broke adb shell on Windows
because it was calling unix_read() with a buffer size of 1 byte which
wasn't supported by unix_read()/_console_read().

This change makes _console_read() support such a small buffer by
maintaining an internal input buffer.

This lets us simplify the existing code that was already maintaining a
cached INPUT_RECORD.

Also eliminate some duplicate code in the big switch statement.

Change-Id: I8f0aed4fb9f6f2f5b9a6b68ce60d2e368fec81c7
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-11 16:59:06 -08:00
Josh Gao
bf666599b3 Merge changes from topic 'adb_dir'
* changes:
  adb: don't explode directories when pushing/pulling.
  adb: improve error handling, comments.
2015-11-11 23:22:48 +00:00
Josh Gao
389cab802a Merge "adb: add 100 column limit to .clang-format." 2015-11-11 22:22:59 +00:00
Josh Gao
32b24cfb5f adb: add 100 column limit to .clang-format.
Change-Id: I7d96a6d505d2ddd92ffe7ad12ffc777c03c63caf
2015-11-11 14:16:07 -08:00
Josh Gao
1a0253092d adb: properly handle path separators on Windows.
Bug: http://b/25573669
Change-Id: Ic82981e1dfe40d5e3b3ffa06e18e62ecf80d81fc
2015-11-11 14:01:46 -08:00
Josh Gao
07db1196e7 adb: don't explode directories when pushing/pulling.
Previously, `adb pull /data/local/tmp` would spew all of the contents of
/data/local/tmp into the current directory. This patch makes push/pull
keep directories intact.

Bug: http://b/25394682
Change-Id: I2304ae9e61745a2b9536f58a6012640bf8ff422a
2015-11-11 14:01:45 -08:00
Josh Gao
12a2ae9a0c adb: improve error handling, comments.
This commit fixes two cases:
  `adb pull /data/local/tmp nonexistent/path` would succeed.
  `adb pull /data/local/tmp nonexistent/` would fail.

Change-Id: I60c39eb2816946686241af42cfa2ad5cdc63fb0e
2015-11-11 14:00:11 -08:00