Commit graph

21491 commits

Author SHA1 Message Date
Todd Kjos
d125f6e8a9 Merge "Mount schedTune cgroup as /dev/stune" into nyc-dev 2016-02-26 17:35:50 +00:00
Lajos Molnar
1e86e1ba1a Merge "keep legacy HAL_DATASPACE enums unchanged" into nyc-dev 2016-02-26 05:06:13 +00:00
Casey Dahlin
97b3e66d3e Introduce unique_fd
unique_fds are wrappers for integer file descriptors that automatically
close when they go out of scope. They are movable but not copyable and
generally mimic the semantics of std::unique_ptr

(cherry-pick from 918b9e8dc6)

Change-Id: I0657b848b6536d5ad9fc06686e240ea5c387b0ac
Test: Considerable exercise in new AIDL integration tests
Bug: None
Signed-off-by: Casey Dahlin <sadmac@google.com>
2016-02-25 17:02:17 -08:00
Mark Salyzyn
dad8361a0e Merge changes Ic15a87f4,I8a53ad3a,I6a03d405 into nyc-dev
* changes:
  liblog: __android_log_error_write use event list library
  liblog: test: __android_log_error_write accuracy
  liblog: add android_log_write_string8_len
2016-02-25 23:55:59 +00:00
Mark Salyzyn
a4f2ef1b05 liblog: __android_log_error_write use event list library
(cherry pick from commit 81f407be36)

Switch to the event list library to compose the associated event.

SideEffects: Instead of composing event on a stack buffer of 512
             bytes in size, a PAGE is allocated temporarily.

Bug: 27356456
Change-Id: Ic15a87f49385834c2287ed82c26439b2c5eb4f77
2016-02-25 15:54:28 -08:00
Mark Salyzyn
d9aee653d1 liblog: test: __android_log_error_write accuracy
(cherry pick from commit 5cecedc6e8)

Add a test to confirm exact expected content using the testframe
setup for the events log handler. Remove dependency on 512 truncation
in liblog->
android_errorWriteWithInfoLog__android_logger_list_read__data_too_large
to something more liberal.

Bug: 27356456
Change-Id: I8a53ad3a16cf16b14856efe5b95417e857c7e09b
2016-02-25 15:53:44 -08:00
Tim Murray
b43225eefb Fix build break with uninitialized boost_fd.
Change-Id: Icf209e2e0f4835db01f61dbf83b4715db9ef03a9
(cherry picked from commit def6c151f4)
2016-02-25 23:53:08 +00:00
Mark Salyzyn
1d5afc9e08 liblog: add android_log_write_string8_len
(cherry pick from commit 67d7eafd56)

android_log_write_string8_len(android_log_context ctx,
                              const char *value, size_t maxlen)

Caps the supplied string to a maxlen length. Alter API to handle
a NULL pointer for the value string for this and
android_log_write_string8() and instead of returning -EINVAL,
act like a null string "" was supplied to preserve the list
location. API is also changed to report the number of characters
actually placed into the android_log_context.

Bug: 27356456
Bug: 19235719
Change-Id: I6a03d405eac1d741555dd05555513ec691e7a46e
2016-02-25 15:53:00 -08:00
Christopher Ferris
82d84897b1 Fix incorrect handling of snprintf return value.
The code assumed that snprintf would never return a value less than
the passed in size of the buffer. This is not accurate, so fix all
of the places this assumptions is made. Also, if the name is too large,
then truncate just the name to make everything fit.

Added a new set of tests for this code. Verified that the old code passes
on the _normal and _exact version of the tests, but fails with the
FORTIFY error on the _truncated version of the tests. All tests pass
on the new code.

Bug: 27324359

(cherry picked from commit 626efb78a6)

Change-Id: Iba60a926cf5a1d6b517a6bfd8c797d724f093010
2016-02-25 14:02:00 -08:00
Dimitry Ivanov
aa2cf3facf Merge "Make libutils symbols protected" into nyc-dev 2016-02-25 21:08:48 +00:00
Mark Salyzyn
d26b2cacad logd: sock_alloc_send_pskb starves pruning
(cherry pick from commit 5c77ad55d0)

Allow socket send syscall to terminate after 32 seconds if reader
stalled because of memory pressure allocating new network buffers

Add a gTest to catch regressions, add security buffer to log_dump

Bug: 27242723
Change-Id: Idaa6699d9d284e7f5f723ae0e76b3d6aa3371489
2016-02-25 12:43:12 -08:00
Mark Salyzyn
317bfb923c logd: Allow (some) headers to be individually importable
(cherry pick from commit 2ad0bd0a9b)

LogReader.h needs to be individually importable.

Fix a few others, drop includes of local includes, let them be
included in source instead and allow headers to be included
alphabetically. Was not a complete audit since goal was to
separate LogReader.h out from the pack.

Bug: 27242723
Change-Id: Ic7759ef90995e5bd285810706af33550c73cf5b5
2016-02-25 12:42:31 -08:00
Ruchi Kandoi
df09aefc16 Merge "healthd: Read the max power supply voltage" into nyc-dev 2016-02-25 20:28:19 +00:00
Alex Klyubin
8a67c09e7d Merge "Only debuggable packages can be downgraded." into nyc-dev 2016-02-25 20:26:54 +00:00
Badhri Jagan Sridharan
40e1df4488 healthd: Read the max power supply voltage
With Type-C PD, VBUS can no longer be assumed to
to be at 5V. Read the "voltage_max" field from the
power_supply class node and export it through
BatteryProperties service.

Bug: 25229483
Change-Id: I04e32d9783a21bab375f1724758a9eeace2a047c
2016-02-25 12:15:54 -08:00
Dimitry Ivanov
2c7960c8d9 Make libutils symbols protected
This change is a workaround for apps linking
libutils statically and dynamically which causes
them to crash for newer version of Android.

Bug: http://b/27313399
Change-Id: I47ac4146041b6eeef03cb605ea436719d552ec8f
2016-02-25 11:44:35 -08:00
Josh Gao
2eaa41a6df adb: fix leak of framework_fd.
Move the fdevent for the framework authentication connection out of
atransport into its own static variable in adb_auth_client, since its
lifetime is completely unrelated to that of the USB connection.

Bug: http://b/27297963
Change-Id: Ie6180d0b59d133120c5755e239e76ab33ed3cc1d
(cherry picked from commit 9f48611554)
2016-02-25 11:01:59 -08:00
Josh Gao
b6117c4397 adb: bail out if wait_for_device fails in send_shell_command.
Bug: http://b/27166186
Change-Id: Ib7e9d7e6b909d67a3af94c3517a6a0b54cf17db7
(cherry picked from commit f56c39194f)
2016-02-25 11:01:38 -08:00
Lorenzo Colitti
b046e74bef Merge "Delete dhcpcd code in system/core, since dhcpcd is no more." into nyc-dev 2016-02-25 07:56:16 +00:00
Lorenzo Colitti
9c07eb9dd8 Delete dhcpcd code in system/core, since dhcpcd is no more.
Bug: 27192644
Change-Id: I44c2ded2da69395f12a8850b2677322b11c2cb91
2016-02-25 16:04:43 +09:00
Nick Kralevich
53e56b9473 Merge "init: harden socket creation against symlinks" into nyc-dev 2016-02-25 06:47:11 +00:00
James Hawkins
1f1b327923 Merge "bootstat: Record the time since factory reset on init." into nyc-dev 2016-02-25 00:49:07 +00:00
Alex Klyubin
85ed97518c Only debuggable packages can be downgraded.
This reflects the change in PackageManager service:
frameworks/base commit 921dd754ab49df0cd580ff96503f7616c4c85f4a.

Bug: 27327503
Change-Id: Ifcc7268cd271640417b8cfc9db81ea954b491cb1
2016-02-24 16:07:47 -08:00
Nick Kralevich
ab5629c197 init: harden socket creation against symlinks
Instead of using chown, use the symlink safe lchown.

Instead of using chmod, use the symlink safe fchmodat
with AT_SYMLINK_NOFOLLOW.

Fix a bug where the SELinux filesystem creation context may
not be restored, and some memory not freed, if bind() fails.

Check the return values from the chown/chmod calls and unlink
the files if it ever fails.

Bug: 27337831
Change-Id: I3343786f5a4eefda7bbb8317f2eca16bd21003c0
2016-02-24 15:50:52 -08:00
Lajos Molnar
88a5ad3f13 keep legacy HAL_DATASPACE enums unchanged
Bug: 25975353
Change-Id: I092b568420aa605425c12de9b245bca7ed602f43
2016-02-24 15:36:57 -08:00
Dimitry Ivanov
426799d770 Add PreloadPublicNativeLibraries function
Shift responsibility of preloading native libraries to the user
of the library. This lets applications that do not use jni but
depend on libnative_loader.so to avoid unnecessary preloads of
public libraries which could be expensive.

Bug: http://b/27245894
Change-Id: I12a8100de5da639c068769bca21ecebff2b2d538
2016-02-24 23:30:27 +00:00
Josh Gao
b236ff7156 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3 am: 512b191d80 -s ours am: 8a7a944fd3 am: aa0afa65c5 am: 77afd98582
am: 8e3e7e9f97  -s ours

* commit '8e3e7e9f97867a2e35e91c3c8733f86d5b387f4d':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:34:55 +00:00
Josh Gao
8e3e7e9f97 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3 am: 512b191d80 -s ours am: 8a7a944fd3 am: aa0afa65c5
am: 77afd98582

* commit '77afd985829024a00aef82f0fb1533a6d4294359':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:28:03 +00:00
Josh Gao
ab4ce73702 resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b am: c663d0482b am: 92e0f8f49d am: 65f7b2d616 am: f25e2dfd3f
am: 3ddc5e7d6d

* commit '3ddc5e7d6db27925a4f87fdbcb60eebd16e65952':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 22:27:55 +00:00
Dan Willemsen
fea11c4d1b Merge "Remove duplicate fdevent.cpp entry" into nyc-dev 2016-02-24 22:23:51 +00:00
Josh Gao
77afd98582 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3 am: 512b191d80 -s ours am: 8a7a944fd3
am: aa0afa65c5

* commit 'aa0afa65c573cbc30ed6afb795b27b12a2f29b31':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:21:02 +00:00
Josh Gao
3ddc5e7d6d resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b am: c663d0482b am: 92e0f8f49d am: 65f7b2d616
am: f25e2dfd3f

* commit 'f25e2dfd3f441b6cfbee30a18bb5507dee28349a':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 22:20:48 +00:00
Josh Gao
aa0afa65c5 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3 am: 512b191d80 -s ours
am: 8a7a944fd3

* commit '8a7a944fd399dc7f9475b7cc2e06681516156e39':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:14:53 +00:00
Josh Gao
f25e2dfd3f resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b am: c663d0482b am: 92e0f8f49d
am: 65f7b2d616

* commit '65f7b2d6169a2a61fe1d607ca55e690721faf31a':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 22:14:05 +00:00
Josh Gao
65f7b2d616 resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b am: c663d0482b
am: 92e0f8f49d

* commit '92e0f8f49d952b365b2be7715a4320d2451d7a67':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 22:06:23 +00:00
Josh Gao
8a7a944fd3 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3
am: 512b191d80  -s ours

* commit '512b191d80f01f514789b33d44b64534708ede51':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:06:23 +00:00
Josh Gao
512b191d80 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours
am: 75708e52d3

* commit '75708e52d3cced48b4726e71ac94f17cd013ee98':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 21:59:29 +00:00
Josh Gao
92e0f8f49d resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b
am: c663d0482b

* commit 'c663d0482b67d028e5b30dbe5f45ef7da2b3e5de':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 21:59:21 +00:00
Josh Gao
c663d0482b resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392
am: b97b07e55b

* commit 'b97b07e55b4ef4312870398bf658b30b41103403':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 21:52:52 +00:00
Josh Gao
75708e52d3 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2
am: 9cde309103  -s ours

* commit '9cde3091033bc367690aa65b814650cdc0e284fe':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 21:46:12 +00:00
Josh Gao
b97b07e55b resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5
am: 7e10520392

* commit '7e105203923041986a1bd125d86495663fee3abf':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 21:37:04 +00:00
Josh Gao
9cde309103 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours
am: 1eb6ec56c2

* commit '1eb6ec56c28aae79dadb62e63e245745fe9485a1':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 21:36:59 +00:00
Josh Gao
1eb6ec56c2 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE
am: bdfb431467  -s ours

* commit 'bdfb43146770f631c7097c378c0dbb8e6f8619a1':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 21:30:37 +00:00
Josh Gao
7e10520392 resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours
am: adc3bcb1d5

* commit 'adc3bcb1d5e4426273223e0889c7f207abb240f2':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 21:30:36 +00:00
Josh Gao
adc3bcb1d5 resolve merge conflicts of 9515c23e16 to klp-modular-dev
am: 91b48c3796  -s ours

* commit '91b48c37962238e3568d6660aeadfcd4d6eb4207':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 21:23:55 +00:00
Josh Gao
bdfb431467 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE
Change-Id: I51653e2ba8e7d1fa345206a4dd8b15f2e29429f2
2016-02-24 13:20:48 -08:00
James Hawkins
c0188da289 bootstat: Record the time since factory reset on init.
Bug: 25448351
Change-Id: I71905a598e74f41c18a96d469c7a6ddd5a2e07fb
(cherry picked from commit 53684ea625)
2016-02-24 13:19:46 -08:00
Nick Kralevich
53b3982a41 ensure /data/tombstones exists on all Android device. DO NOT MERGE am: 9c0ed66313 am: c61a896f20 -s ours am: d61ebb0851 am: 75ccd732f3 -s ours am: 505a431468 am: b760e61686 -s ours am: d5cb8b417b am: 77dd50b470 am: 89c789ae47
am: 4a843ec4e4  -s ours

* commit '4a843ec4e42b02eae240d32a9c206afde186f370':
  ensure /data/tombstones exists on all Android device. DO NOT MERGE
2016-02-24 21:17:04 +00:00
Nick Kralevich
4a843ec4e4 ensure /data/tombstones exists on all Android device. DO NOT MERGE am: 9c0ed66313 am: c61a896f20 -s ours am: d61ebb0851 am: 75ccd732f3 -s ours am: 505a431468 am: b760e61686 -s ours am: d5cb8b417b am: 77dd50b470
am: 89c789ae47

* commit '89c789ae47031eb6bde161991005f7a6e8198556':
  ensure /data/tombstones exists on all Android device. DO NOT MERGE
2016-02-24 21:06:44 +00:00
Nick Kralevich
89c789ae47 ensure /data/tombstones exists on all Android device. DO NOT MERGE am: 9c0ed66313 am: c61a896f20 -s ours am: d61ebb0851 am: 75ccd732f3 -s ours am: 505a431468 am: b760e61686 -s ours am: d5cb8b417b
am: 77dd50b470

* commit '77dd50b4707b0b2b12d4ca136d8c0529d18eedc1':
  ensure /data/tombstones exists on all Android device. DO NOT MERGE
2016-02-24 20:57:19 +00:00