Commit graph

23916 commits

Author SHA1 Message Date
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
87ef739dba Merge "Fix access check" 2016-08-29 22:15:23 +00:00
Treehugger Robot
10348cbeb9 Merge "Convert to Android.bp" 2016-08-29 20:32:12 +00:00
Christopher Ferris
73d2cc570d Merge "Update for kernel headers v4.7.2." 2016-08-29 19:14:10 +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
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
091b631915 Merge "Replace libziparchive-host with libziparchive" 2016-08-26 20:18:55 +00: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
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
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
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
Josh Gao
5990191c4e adb: check our socketpair ends in our win32 emulation.
In our Win32 socketpair emulation, check that the ends are properly
connected before returning.

Change-Id: I33d356fd9ebcac89fc6a89a5200e926032220383
Test: no additional failing tests in adb_test.exe
2016-08-24 13:06:06 -07:00
Mark Salyzyn
6322efe522 Merge "liblog: add __android_log_close()"
am: 812d1c7ea2

Change-Id: I2ba5ed22e78564a864bab6b550b6d2bd2609a629
2016-08-24 16:05:05 +00:00
Mark Salyzyn
2d562c9dce Merge "logger: validate hdr_size field in logger entry"
am: fcf7ab8b1b

Change-Id: Ic88fe616256ab4949040771d3bed1dfb823ab981
2016-08-24 16:05:04 +00:00
Treehugger Robot
812d1c7ea2 Merge "liblog: add __android_log_close()" 2016-08-24 15:58:48 +00:00
Treehugger Robot
fcf7ab8b1b Merge "logger: validate hdr_size field in logger entry" 2016-08-24 15:56:23 +00:00
Mark Salyzyn
8b1f7b595c Merge "libcutils: Add ashmem_valid() function"
am: d00c7470ea

Change-Id: Ib09d3ee7bb131c30f59ea273f357c045394206fb
2016-08-24 15:48:55 +00:00
Treehugger Robot
d00c7470ea Merge "libcutils: Add ashmem_valid() function" 2016-08-24 15:39:06 +00:00
Elliott Hughes
8615d79d85 Merge "Most accept/accept4 calls in system/core don't actually want the remote address."
am: 299d64144b

Change-Id: I3fb9678dfed08f0b1d6e90e547ecae6cdcabc9a1
2016-08-23 23:03:20 +00:00
Treehugger Robot
299d64144b Merge "Most accept/accept4 calls in system/core don't actually want the remote address." 2016-08-23 22:48:24 +00:00
Mark Salyzyn
ee431112ff libcutils: Add ashmem_valid() function
Bug: 30310689
Change-Id: I14c52c5d52745a725799652b87c86281ac214899
2016-08-23 15:29:28 -07:00
Mark Salyzyn
df7a4c6bae liblog: add __android_log_close()
Bug: 30963384
Change-Id: I901e6ac2cc3c601bbecc2d64e00a98e2ab448210
2016-08-23 15:25:03 -07:00
Mark Salyzyn
305374cf0f logger: validate hdr_size field in logger entry
- check hdr_size to make sure it is in the expected range
  from sizeof entry_v1 to entry (entry_v4).
- alter msg() method to report NULL on invalid hdr_size
- alter all users of msg() method.

Bug: 30947841
Change-Id: I9bc1740d7aa9f37df5be966c18de1fb9de63d5dd
2016-08-23 14:51:50 -07:00
Josh Gao
504d4ccd7c Merge "debuggerd: don't display fault addr for manually sent signals."
am: ad52cbb9ec

Change-Id: I34284b398c32dbdfe2074d44d316f81fc45deee8
2016-08-23 21:23:15 +00:00
Treehugger Robot
ad52cbb9ec Merge "debuggerd: don't display fault addr for manually sent signals." 2016-08-23 21:03:18 +00:00
Elliott Hughes
0d2ef3dc86 Merge "debuggerd: set SOCK_NONBLOCK in accept rather than later."
am: 82b67fff06

Change-Id: I6f2e72a4847fbfac8e1ba78321be7e026f7629bd
2016-08-23 20:05:48 +00:00
Elliott Hughes
3dcfa3fb1c Most accept/accept4 calls in system/core don't actually want the remote address.
So don't write the extra code for it or waste the kernel's time
copying it around.

Change-Id: I93de64064c2d4fe58ba5b5322cfa69bf31a76dad
2016-08-23 12:50:00 -07:00
Elliott Hughes
82b67fff06 Merge "debuggerd: set SOCK_NONBLOCK in accept rather than later." 2016-08-23 19:35:54 +00:00
Josh Gao
344ca5a681 debuggerd: don't display fault addr for manually sent signals.
Bug: http://b/30819045
Change-Id: Ic8ab21298dcba6acdfa876e7c729b14b0bf2afbb
Test: `killall -TRAP surfaceflinger` no longer shows fault addr,
      crasher still does
2016-08-23 12:31:14 -07:00
Daniel Rosenberg
559cc01e3e resolve merge conflicts of 40eff95 to stage-aosp-master
Change-Id: I91935ba9603ffd41af2009adc13a024701619c52
2016-08-22 20:13:52 -07:00
Daniel Rosenberg
40eff9534e Merge changes I9f380f31,Ieab6bed7,Ia870e4be,I939b1e01,I8b723dda
* changes:
  Add skip-secondary flag
  Switch fastboot to new A/B spec
  Add Fastboot support for flashing secondary images
  Handle invalid suffix lists
  Call set_active after flashall and update
2016-08-23 02:18:33 +00:00
Elliott Hughes
33f8c194f9 Merge "liblog: use SOCK_NONBLOCK directly."
am: fca43d3ec5

Change-Id: I4d959d9091adbf8bf2d7b68653a3c6064893a65a
2016-08-23 01:20:36 +00:00
Josh Gao
e4d79532de Merge "adb: increase the authentication throttling limit."
am: 393e5258f6

Change-Id: I483cf75ced8d9fb896c2f5e417d258970d7cabb1
2016-08-23 01:11:28 +00:00
Treehugger Robot
fca43d3ec5 Merge "liblog: use SOCK_NONBLOCK directly." 2016-08-23 01:08:18 +00:00
Treehugger Robot
393e5258f6 Merge "adb: increase the authentication throttling limit." 2016-08-23 00:12:52 +00:00
Elliott Hughes
5ba3003467 liblog: use SOCK_NONBLOCK directly.
No need to have a race, even if it doesn't matter.

Change-Id: Ia79f2633643bc63618de0fd85953b3226415484f
2016-08-22 16:19:58 -07:00
Josh Gao
8270912ed0 Merge changes I9761298a,I8d3312b2
am: 0b4fcb75d4

Change-Id: I330c467e408bc10ebdab0f5708d24d2297cf39a2
2016-08-22 21:38:53 +00:00
Treehugger Robot
0b4fcb75d4 Merge changes I9761298a,I8d3312b2
* changes:
  adb: fix public key authorization.
  adb: add support for vendor key directories.
2016-08-22 21:34:18 +00:00
Elliott Hughes
874c674c60 debuggerd: set SOCK_NONBLOCK in accept rather than later.
Change-Id: I95586984dd7aec798d75b150be238d5f6f7c91da
2016-08-22 14:17:25 -07:00
Josh Gao
c8cb38803a adb: increase the authentication throttling limit.
Previously, after 10 failed authentications, we'd sleep for a second,
and we're up to 11 vendor keys in internal now...

Bug: http://b/30927527
Change-Id: I094e830521f6a2768a880c6684f32ff1ce2a3c2e
2016-08-22 13:12:32 -07:00