Commit graph

18429 commits

Author SHA1 Message Date
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
Jorge Lucangeli Obes
ae0f53cf69 Merge "Fix typo, caps in error messages." 2015-11-11 21:55:30 +00:00
Jorge Lucangeli Obes
f39c56456d Fix typo, caps in error messages.
Bug: None
Change-Id: I673189f84812637c240321b72cf77b26b170b6ad
2015-11-11 11:34:14 -08:00
Calin Juravle
7605a56fbc Merge "Create a folder to store method traces activated with -Xmethod-trace" 2015-11-11 18:07:13 +00:00
Elliott Hughes
fdebc26ad5 Merge "Revert "adb/base: fix adb push of Unicode filenames on Win32"" 2015-11-11 18:01:34 +00:00
Elliott Hughes
cc8cd59456 Revert "adb/base: fix adb push of Unicode filenames on Win32"
This reverts commit ac9514a452.

The new gettid dependency caused other breakage.

Change-Id: I74a75e40c30a45beb275f9dd38eb5c7beac15fbd
2015-11-11 18:01:12 +00:00
Elliott Hughes
332166a31a Merge "adb/base: fix adb push of Unicode filenames on Win32" 2015-11-11 17:10:01 +00:00
Spencer Low
ac9514a452 adb/base: fix adb push of Unicode filenames on Win32
ae5a6c06cd made adb push use
android::base::ReadFileToString() for small files, but that API did not
support UTF-8 filenames on Windows, until this fix which does the
following:

- Add android::base::{WideToUTF8,UTF8ToWide}() which are only available
  on Windows. The signatures are based on Chromium's APIs of the same
  name.

- Add the namespace android::base::utf8 which has versions of APIs that
  take UTF-8 strings. To use this, make sure your code is in a namespace
  and then do "using namespace android::base::utf8;". On Windows, this will
  make calls to open() call android::base::utf8::open(), and on other
  platforms, it will just call the regular ::open().

- Make ReadFileToString() and WriteStringToFile() use utf8::open() and
  utf8::unlink().

- Adapt unittests from Chromium.

- fastboot needs to link with libcutils because it links with libbase
  which depends on libcutils for gettid() for logging.

Change-Id: I1aeac40ff358331d7a1ff457ce894bfb17863904
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-10 15:48:54 -08:00
Christopher Wiley
2f33e0cb17 Merge "libutils: Add UNEXPECTED_NULL status_t" 2015-11-10 22:20:54 +00:00
Calin Juravle
9b3e5d59fe Create a folder to store method traces activated with -Xmethod-trace
Bug: 25612377
Change-Id: I370b858594ccc88c12099b23a0d1aac22acd4969
2015-11-10 21:26:40 +00:00
Bertrand SIMONNET
0a1119f0ce metricsd: Fix logging initialization.
metricsd should only log to a single location (stderr or syslog):
* standard error if --logtostderr is set or metricsd runs in the
  foreground.
* syslog if --logtosyslog is set or metricsd is daemonized.

Bug: 25472752
Change-Id: Idb918714e1b6975d79682f22495a7ca708d4d97d
2015-11-10 11:50:41 -08:00
Elliott Hughes
3c540aec24 Merge "Add -e to the adb shell documentation." 2015-11-10 19:25:14 +00:00
Christopher Wiley
c3441e69c0 libutils: Add UNEXPECTED_NULL status_t
We use this specifically in situations where we expect to read
an object from a Parcel, but fail because the object is null.

Bug: 25617251

Change-Id: Id0b6118b19a932998b5028e30dc15d70e4d7f9c3
2015-11-10 11:12:43 -08:00
Elliott Hughes
0e42c2a4ad Add -e to the adb shell documentation.
Change-Id: I7be5d198ef174e969bbb670e629369894c7b0994
2015-11-10 10:54:44 -08:00
Elliott Hughes
d75b6b9257 Merge "libpixelflinger: MIPS64r6 bug fix" 2015-11-10 15:48:46 +00:00
Ljubomir Papuga
4edb4584a6 libpixelflinger: MIPS64r6 bug fix
This commit fixes MIPS64r6 bootanimation crash.

Change-Id: If7ca817ee2beaf92bb8052602cc759bb4a609419
2015-11-10 14:24:11 +01:00
Josh Gao
0bb1ce06ea Merge "adb: don't try to pull character or block devices." 2015-11-10 02:22:47 +00:00
Josh Gao
8d00a39eff adb: don't try to pull character or block devices.
Change-Id: I1a9e2c0097fe9c4017a9b338e812366c8e1154f0
2015-11-09 18:12:10 -08:00
Josh Gao
5a08fd35c9 Merge "adb: demote skipping a file from an error to a warning." 2015-11-10 02:02:41 +00:00
Josh Gao
21abf5a7c1 adb: demote skipping a file from an error to a warning.
Change-Id: If6c88e8855369bd7feb570ac5310fc7f44994083
2015-11-09 17:47:56 -08:00
Elliott Hughes
79964cdf86 Merge "Fix adb shell escape handling." 2015-11-10 01:06:58 +00:00
Tom Cherry
48f2e1ed31 Merge "Fix isValid() condition for libsync tests" 2015-11-09 22:27:56 +00:00
Elliott Hughes
28416d6d33 Fix adb shell escape handling.
Start of input is, by definition, the start of a line. Give the states
names to make the error clearer. We should also swallow the escape
character until/unless it's proven not to have been part of an escape
sequence. Finally, implement an ssh(1)-like -e option so the user can
choose -- or, more importantly, disable -- escape character handling.

Change-Id: I28a91db47e15f3e7de96303c0b9a98d302b9c92e
2015-11-09 13:57:47 -08:00
Nick Kralevich
2d8f1d4c47 Merge "Enable hidepid=2 on /proc" 2015-11-09 20:05:22 +00:00
Elliott Hughes
892f0e9300 Merge "adb/base: minor compiler portability improvements" 2015-11-09 18:22:42 +00:00
Spencer Low
363af568b8 adb/base: minor compiler portability improvements
I've been using these changes to compile with Visual Studio.

- GetFileBasename(): __FILE__ uses \ with Visual Studio.

- adb_trace.cpp: Apparently VS needs an ampersand before the function name.

- "expr1 ? : expr2" is a GCC extension.

- <algorithm> contains std::min().

- seekdir can't always be #define'd because some headers have members
  named seekdir.

- adb_utils.cpp: Not really a compiler issue, just a random fix:
  0x7F/DEL is not printable.

Change-Id: I0dfb634f1ba4ccbc0d1b9f71b00e838fbebb3b41
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-09 10:22:13 -08:00
Rom Lemarchand
24e3b8d091 Merge "init: skip "name" DT entry" 2015-11-09 17:35:09 +00:00
Nick Kralevich
c39ba5ae32 Enable hidepid=2 on /proc
Add the following mount options to the /proc filesystem:

  hidepid=2,gid=3009

This change blocks /proc access unless you're in group 3009
(aka AID_READPROC).

Please see
  https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt
for documentation on the hidepid option.

hidepid=2 is preferred over hidepid=1 since it leaks less information
and doesn't generate SELinux ptrace denials when trying to access
/proc without being in the proper group.

Add AID_READPROC to processes which need to access /proc entries for
other UIDs.

Bug: 23310674
Change-Id: I22bb55ff7b80ff722945e224845215196f09dafa
2015-11-09 09:08:46 -08:00
Rom Lemarchand
1dcf325844 init: skip "name" DT entry
DTs have a standard "name" entry which is not to be
turned into an android property, so skip it.

Change-Id: I79f6638b4123358c8d80510c1666cf5d4561160e
2015-11-08 17:51:50 -08:00
Elliott Hughes
54b5e85373 Merge "AOSP master doesn't have "cmd"." 2015-11-07 17:05:12 +00:00
Elliott Hughes
79e1c7a7f8 AOSP master doesn't have "cmd".
Change-Id: I0f524b779a623a9e2db923fd9003b102460ae46f
2015-11-06 18:05:16 -08:00
Elliott Hughes
ae2a64e2ba Merge "use new cmd command" 2015-11-07 02:03:31 +00:00
Todd Kennedy
6fa848adba use new cmd command
Instead of using the pm command, 'adb install' and 'adb uninstall' will now
use the cmd command. Additionally, the APK will be streamed directly to
package installer instead of creating a temporary file.

(cherry-pick of d039800a4e008b52c532f901e3bb34b40877cf30.)
Change-Id: Ie7529afa5b039d29cc8183f36085ff4e66b3457a
2015-11-06 18:00:05 -08:00
Josh Gao
7fc45c3326 Merge "adb: pull empty directories." 2015-11-07 00:53:03 +00:00
Josh Gao
8c2fb1f3de Merge "adb: remove superfluous checks." 2015-11-07 00:52:12 +00:00
Josh Gao
a837df8590 adb: remove superfluous checks.
Change-Id: I4d9ceb301b0d242b0bad9a0faa8e2a1824f36cca
2015-11-06 15:19:53 -08:00
Josh Gao
6580096c97 adb: pull empty directories.
Pushing empty directories is more troublesome, and probably either
requires changes to the server, or hacky `adb shell mkdir` stuff.

Bug: http://b/25395071
Change-Id: I4db6a993429a56e5c5ca994752418503b6f5d7c4
2015-11-06 15:04:24 -08:00
Bertrand Simonnet
9940a132fb Merge "metricsd: add SendBoolToUMA to metrics interface" 2015-11-06 20:47:58 +00:00
Josh Gao
f00db9d8b8 Merge "adb: add basename_lock to mutex_list.h." 2015-11-06 20:43:49 +00:00
Josh Gao
a239543061 Merge changes Iced6c414,Ie82d51ec
* changes:
  adb: make local_build_list match remote_build_list.
  adb: C++ify more of the push/pull functions.
2015-11-06 20:22:24 +00:00