Commit Graph

24282 Commits

Author SHA1 Message Date
Felipe Leme 680f4a4888 DO NOT MERGE: Split 'generating' and 'pulling' in 2 messages.
BUG: 30799929
Change-Id: I0af0ad2478c57ffc5b2c953118e01677f788d14a
(cherry picked from commit 9c0be90528)
(cherry picked from commit 321c21e2df)
2016-08-30 13:06:37 -07:00
Felipe Leme f33fcb6418 DO NOT MERGE: Ignore bugreportz output when it's not supported.
On devices running M or below, calling 'bugreportz -v' writes
'/system/bin/sh: bugreportz: not found' in the stdout output, which must
be redirected to stderr so it's not shown in the flat-file bugreport,
above the bugreport header.

BUG: 30451114

Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a
(cherry picked from commit 9a882a3ef3)
(cherry picked from commit b0022b036e)
2016-08-30 13:06:35 -07:00
Felipe Leme b3239728bb DO NOT MERGE: Deprecated 'adb bugreport' with flat files.
Starting on Android N, zipped bugreports contain more information than
flat-file, text bugreports. On N, calls to 'adb bugreport' would still
generate a flat-file bugreport, but with a warning.

With this change, 'adb bugreport' will generate a zipped bugreport in
the current directory, using the bugreport name provided by the
device. Similarly, calling 'adb bugreport dir' will generate a bugreport
with a device-provided name, but in such directory.

BUG: 30451114
BUG: 29448020

Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90
(cherry picked from commit 307951e124)
(cherry picked from commit f8d9e4eb00)
2016-08-30 13:06:33 -07:00
Felipe Leme 6e2869680c DO NOT MERGE: Minor improvements on bugreport generation.
- Skipped artificial 100/100 message, since pulling will take care of
  the final 100% progress.
- Consolidated unsupported lines in just one message.
- Let user know the bugreport can still be recovered when it could not
  be copied to the destination directory.

BUG: 30451114

Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab
(cherry picked from commit 80a65d03c9)
(cherry picked from commit 5f6eacaeda)
2016-08-30 13:06:32 -07:00
Felipe Leme daf4628f36 DO NOT MERGE: Removed extra 'pulling file' message.
Taking a zip bugreport has 2 phases: generating the bugreport and
pulling the file.

Initially adb was printing 2 messages, but since the latter is almost
instantaneously, it could be confusing to have 2 lines...

Fixes: 30451250
Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f
(cherry picked from commit f7c38b4c03)
(cherry picked from commit 33ae849fef)
2016-08-30 13:06:30 -07:00
Felipe Leme 6f5080faa5 DO NOT MERGE: Show bugreport progress.
adb calls bugreportz to generate a bugreport; initially, bugreportz
would only report the final status of the operation (OK or FAIL), but
now it sends intermediate PROGRESS lines reporting its progress (in the
form of current/max).

Similarly, the initial implementation of 'adb bugreport <zip_file>'
would print an initial 'please wait' message and wait for the full
stdout before parsing the result, but now it uses a new callback class
to handle the stdout as it is generated by bugreportz.

BUG: 28609499

Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1
(cherry picked from commit cd42d658b2)
(cherry picked from commit 97b73a0daf)
2016-08-30 13:06:28 -07:00
Felipe Leme 0d4f0508c0 DO NOT MERGE: Refactored functions that copy sdout and stderr to strings to use a callback.
BUG: 28609499

Change-Id: I04aea346e18678ea00797f7f659480edba4436c2
(cherry picked from commit 07ac8554b4)
(cherry picked from commit d18854218e)
2016-08-30 13:06:26 -07:00
Felipe Leme 698e065e14 DO NOT MERGE: Split bugreport() into its own file and added unit tests.
bugreport() will be soon refactored to track progress, which will
require more comprehensive unit tests.

As such, it's better to move it to its own files, which in turn also
requires moving send_shell_command() and usage() to commandline.h.

Fixes: 30100363
Bug: 30268737

Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0
(cherry picked from commit 78e0963e4b)
(cherry picked from commit 218e1ff759)
2016-08-30 13:06:23 -07:00
Todd Kennedy 248722e7eb DO NOT MERGE: use 'cmd' command for install-multiple
adb install-multiple makes a minimum of 3 calls to the 'pm' command. This
causes at least 3 separate "pm" processes to be spun up. Instead, use the
'cmd' command which runs in the existing system_server process.

Bug: 27483932
Change-Id: Ia1bed405c3d7e675a1a56ff82c692aaa94388a5c
(cherry picked from commit 4838ae1ab5)
2016-08-30 13:06:12 -07:00
Christopher Tate c42f1bb3e9 DO NOT MERGE: Ensure the target sees a proper EOD marker during restore
Malformed or corrupt archives may be missing their in-band EOD
content, so make sure that the target sees one regardless rather
than continuing to block on read, expecting in-band signaling.

Bug 28056941

Change-Id: Ic39966d3448787a8c511783d39172032ed9589c3
(cherry picked from commit 2bcdda8e5d)
2016-08-30 13:06:05 -07:00
John Reck cf2f39d7de Merge "Fix access check" am: 87ef739dba
am: 9cbbe2d9df

Change-Id: I988a5e71b02442a7509f9cfc7a1d17aa1b52571d
2016-08-30 01:24:37 +00:00
Dan Willemsen 51043f5e1d Merge "Convert to Android.bp" am: 10348cbeb9
am: ded1346ca5

Change-Id: I4bbb674d75f089f66a3744a6341cf999054c429c
2016-08-30 01:24:37 +00:00
The Android Automerger 5a33ad4d52 Merge commit '6a5fa76' into nyc-dev-plus-aosp 2016-08-30 00:58:39 +00:00
John Reck 9cbbe2d9df Merge "Fix access check"
am: 87ef739dba

Change-Id: Iee618c55186988f79e926a34cd7692f1d01a7f99
2016-08-29 22:28:56 +00:00
John Reck 87ef739dba Merge "Fix access check" 2016-08-29 22:15:23 +00:00
Josh Gao 6496c4bf6f base: disallow close() on unique_fd.
unique_fd's implicit conversion to int allows it to be passed to
close(2), which is dangerous because unique_fd will think that it still
has ownership of the now-closed fd. Disallow this by providing an
overload for close that's tagged with an attribute that gives a
compile-time error.

Test: m
Change-Id: I514591335b337f2f57c1df371cf3979304aea17c
2016-08-29 14:37:49 -07:00
Dan Willemsen ded1346ca5 Merge "Convert to Android.bp"
am: 10348cbeb9

Change-Id: Ica8fd833a664df6255f3835f2c755751bb98f8d5
2016-08-29 20:40:25 +00:00
Treehugger Robot 10348cbeb9 Merge "Convert to Android.bp" 2016-08-29 20:32:12 +00:00
Mitchell Wills 6a5fa764c1 Merge "Tag hostapd binary with CAP_NET_ADMIN | CAP_NET_RAW" into stage-aosp-master 2016-08-29 20:03:19 +00:00
Christopher Ferris 99bb22da1b Merge "Update for kernel headers v4.7.2." am: 73d2cc570d
am: c4abab8578

Change-Id: I54f9530180e9d42032ed06fa7670125e5de0e4cf
2016-08-29 19:21:49 +00:00
Christopher Ferris c4abab8578 Merge "Update for kernel headers v4.7.2."
am: 73d2cc570d

Change-Id: I7ec40925a8d6330ea40e31de499576989ea1b63d
2016-08-29 19:18:15 +00:00
Andreas Gampe 95606ec918 Merge "Libbase: add C++11 support to DISALLOW_IMPLICIT_CONSTRUCTORS" am: e7f3a0f9cf
am: f4878c6b88

Change-Id: I6034288ab01774e75bd101ad8625f334de94877c
2016-08-29 19:15:08 +00:00
Christopher Ferris 73d2cc570d Merge "Update for kernel headers v4.7.2." 2016-08-29 19:14:10 +00:00
Andreas Gampe f4878c6b88 Merge "Libbase: add C++11 support to DISALLOW_IMPLICIT_CONSTRUCTORS"
am: e7f3a0f9cf

Change-Id: I691b16739bf2dcc5380e3281ee37b9a0f9e92c37
2016-08-29 19:11:39 +00:00
Treehugger Robot e7f3a0f9cf Merge "Libbase: add C++11 support to DISALLOW_IMPLICIT_CONSTRUCTORS" 2016-08-29 18:59:38 +00:00
Andreas Gampe 247924a36f Libbase: add C++11 support to DISALLOW_IMPLICIT_CONSTRUCTORS
Use delete when possible.

Test: m
Test: m test-art-host
Change-Id: Ib741564c7a31348b2f706fe55eb23d9886f865e3
2016-08-29 09:36:31 -07:00
Josh Gao 4c58c8a892 Merge "adb: factor out socket specification." am: bd7d2e2ec0
am: f95e728431

Change-Id: Ibbed2dea019538491650eab41bd75e4f7546a909
2016-08-27 03:02:17 +00:00
Josh Gao f95e728431 Merge "adb: factor out socket specification."
am: bd7d2e2ec0

Change-Id: I14f452e11395139f5687e5096af5b278eb14d63d
2016-08-27 02:58:50 +00:00
Treehugger Robot bd7d2e2ec0 Merge "adb: factor out socket specification." 2016-08-27 02:50:34 +00:00
Christopher Ferris f83c7923f9 Update for kernel headers v4.7.2.
The new uapi kernel headers added a new SEGV reason code, so
add it to the tombstone code.

Update sync.c to include the needed data structures itself. Someone
else will be fixing this to work on old versus new kernels.

Change-Id: Icb27713ea38a20003c7671a9bca262eebd96099b
2016-08-26 16:48:18 -07:00
Dan Willemsen 194edf772e Convert to Android.bp
See build/soong/README.md for more information.

I tested the following tests on a Nexus9 and linux host, and they
continued to pass:

/data/nativetest{,64}/bootstat_tests/bootstat_tests
out/host/linux-x86/bin/nativetest{,64}/bootstat_tests/bootstat_tests
/data/nativetest64/memunreachable_test/memunreachable_test
out/host/linux-x86/bin/nativetest{,64}/memunreachable_test/memunreachable_test

These continue to fail just like before this change:

/data/nativetest{,64}/sync_test/sync_test (was /system/bin/sync_test)
/data/nativetest{,64}/sync-unit-test/sync-unit-test
/data/nativetest/memunreachable_test/memunreachable_test

Test: See above
Change-Id: I691e564e0cf008dd363e3746223b153d712e024d
2016-08-26 16:19:21 -07:00
John Reck 2e336b1da1 Fix access check
Fixes a bug where USE_CPUSET used access(F_OK)
as a sign that it should try writing to the cpuset
path. It needs to instead use access(W_OK) to
ensure that it has write access as that's what
it would try to open() with.

And stop trying to repeatedly open a file that
doesn't exist.

Change-Id: Ib391ee6f08345051c48a986a732eda30143cb614
2016-08-26 14:05:03 -07:00
Colin Cross 4379ca6d18 Merge "Replace libziparchive-host with libziparchive" am: 091b631915
am: 904c1042cd

Change-Id: I3e3a49fb45d5387af675e8d7b20974796d3ee962
2016-08-26 20:32:28 +00:00
Colin Cross 904c1042cd Merge "Replace libziparchive-host with libziparchive"
am: 091b631915

Change-Id: I4ee6244e8fc2fad0edd17be39cd275abbcf8e62d
2016-08-26 20:25:33 +00:00
Colin Cross 091b631915 Merge "Replace libziparchive-host with libziparchive" 2016-08-26 20:18:55 +00:00
Christopher Wiley a76088362e Tag hostapd binary with CAP_NET_ADMIN | CAP_NET_RAW
Bug: 30041118
Change-Id: I14d1fd601fc4bce12c563a2004e91bd8ba0f42c3
Test: hostapd can start as the wifi user with these capabilities.
(cherry picked from commit 2502490178)
2016-08-26 13:13:39 -07:00
Colin Cross 99f6b86733 Replace libziparchive-host with libziparchive
libziparchive-host is no longer necessary, and mixing libziparchive-host
and libziparchive can cause ODR violations.

Change-Id: I27b2cc9974000ee7bf1d1ac15fd7b069862d9b01
2016-08-26 11:12:38 -07:00
Josh Gao cfb21412e5 adb: factor out socket specification.
Move the logic for string socket specification out to separate
functions to facilitate using arbitrary sockets for the adb command
socket.

Bug: http://b/30445394
Change-Id: Icd8fdb853272edc029fb3a0f5b18e941dc8ef52c
Test: adb_test, adbd_test, test_device.py
2016-08-25 17:12:26 -07:00
Martijn Coenen ade3876260 Merge changes from topic 'utf' am: 3a07e5bf94
am: aa7fd8a3ec

Change-Id: I3c90317d492a84ff99b18463d6f489e7b1cca61b
2016-08-25 20:24:14 +00:00
Martijn Coenen aa7fd8a3ec Merge changes from topic 'utf'
am: 3a07e5bf94

Change-Id: I4a1b0a32f4b2895ce170ce3a7cf6a30dfeca118f
2016-08-25 20:18:18 +00:00
Martijn Coenen 3a07e5bf94 Merge changes from topic 'utf'
* changes:
  libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
  Unicode: specify destination length in utf8_to_utf16 methods
2016-08-25 20:08:14 +00:00
Sergio Giro 1cfa56d46c libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

Test: ran libutils_tests
Bug: 29250543
Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb
(cherry picked from commit c4966a363e)
2016-08-25 20:07:51 +00:00
Sergio Giro 9de6776321 Unicode: specify destination length in utf8_to_utf16 methods
String16(const char *utf8) now returns the empty string in case
a string ends halfway throw a utf8 character.

Bug: 29267949
Clean cherry-pick from 1dcc0c8239

Change-Id: I5223caa7d42f4582a982609a898a02043265c6d3
2016-08-25 19:57:06 +00:00
Josh Gao 87ff463d6e Merge changes I0ee130db,I33d356fd am: e461b37965
am: 59561a64b7

Change-Id: If05615e9e5e69bb496fa9eb3c49ba7f9f5a41c45
2016-08-25 02:06:55 +00:00
Josh Gao 59561a64b7 Merge changes I0ee130db,I33d356fd
am: e461b37965

Change-Id: I4a2fe8cec7db8db9b6f701dace34d76879b13e7e
2016-08-25 02:03:56 +00:00
Josh Gao e461b37965 Merge changes I0ee130db,I33d356fd
* changes:
  adb: remove unnecessary addr arguments to accept.
  adb: check our socketpair ends in our win32 emulation.
2016-08-25 01:59:23 +00:00
Hans Boehm 7dddf9433c Merge "Make RefBase more robust and debuggable" am: daac359be7
am: 7bf3d21fde

Change-Id: I643c4bd38062b80d382c50ed161f5440f35c1dd9
2016-08-24 23:49:14 +00:00
Hans Boehm 7bf3d21fde Merge "Make RefBase more robust and debuggable"
am: daac359be7

Change-Id: I9844b2260b607987c688869c643560d5b9c92d75
2016-08-24 23:46:16 +00:00
Hans Boehm daac359be7 Merge "Make RefBase more robust and debuggable" 2016-08-24 23:36:13 +00:00
Josh Gao 78e1eb1949 adb: remove unnecessary addr arguments to accept.
Follow up to https://android-review.googlesource.com/#/c/261412/

Change-Id: I0ee130db302940f3224cc823a26b02fc45da0fca
Test: mma
2016-08-24 13:06:06 -07:00