Commit graph

2366 commits

Author SHA1 Message Date
Miodrag Dinic
192be1dcae [qemu]: Fix payload size format in qemu_pipe_frame_send()
The following change introduced regression for booting AOSP
on emulator for all architectures:

7c7990e Fix warnings in system/ headers

qemu_pipe expects payload size in the message header to be in hex format,
as stated in the comment for qemu_pipe_frame_send().

Change-Id: I32cfa9c9b2af56f93bbda0ea5597451c389ae45e
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
2016-09-30 13:58:11 +02:00
Colin Cross
0763c30289 Merge "Fix more system/core/include warnings" am: 18fbd80504 am: 5fe194a9fd
am: b5ca47989c

Change-Id: I8d5a602f94bc57866aa3827cc508c94afb4ac4ba
2016-09-29 17:58:08 +00:00
Colin Cross
b5ca47989c Merge "Fix more system/core/include warnings" am: 18fbd80504
am: 5fe194a9fd

Change-Id: I8e561ab27f93ed10efa8a0e864cd7d1283bb6163
2016-09-29 17:42:19 +00:00
Colin Cross
18fbd80504 Merge "Fix more system/core/include warnings" 2016-09-29 17:20:30 +00:00
Mark Salyzyn
ae1612c54c Merge "liblog: fix errno issues with event tag map" am: dfd30c4a16 am: 930ff186ce
am: 71b38def04

Change-Id: I83de9e374a67946fde8191d63720b102690d468f
2016-09-28 18:21:01 +00:00
Mark Salyzyn
71b38def04 Merge "liblog: fix errno issues with event tag map" am: dfd30c4a16
am: 930ff186ce

Change-Id: Iac84f40e9e79063bee7f213eb21ff5f866462a32
2016-09-28 18:17:49 +00:00
Colin Cross
1811d156e9 Fix more system/core/include warnings
The warnings in these files were hidden by -isystem
framework/native/include.

Bug: 31752268
Test: m -j
Change-Id: I2a54376aea380ee24e6483fb7d35fdfe8991c490
2016-09-27 16:21:12 -07:00
Mark Salyzyn
70a83dc7b3 liblog: fix errno issues with event tag map
Cleanup.

Save the errno for the calls that fail, and reinstate them for
return. Drop fprintf stutter, one succinct line. Solve a memory
leak in close.  Change android_lookupEventTag() to use an
unsigned int so that we can use the full range of uint32_t tags.

Make sure this file compiles clean in C++.

Test: gTest liblog-unit-tests
Bug: 30963384
Bug: 31456426
Change-Id: I6a5efa6fb7e991431caba75ef0971e111968f6bf
2016-09-26 09:23:55 -07:00
Chia-I Wu
fd3ea3d118 Add native_handle_clone
libhwbinder's Parcel::readNativeHandleNoDup returns a temporary
native_handle_t.  We want a way to save the temporary handle for later
use.

Change-Id: I16f32043aa8b7d2c0aa57d67551500259b411410
2016-09-26 21:59:04 +08:00
David Pursell
7bc0052ff1 Merge "Flattenable: switch from assignment to memcpy()." am: b2356a6993 am: bb276d8555
am: 9f106bece8

Change-Id: I43e4e5c6bb0aa1fd23a1d0d9776c9e2c8028527e
2016-09-23 22:56:01 +00:00
David Pursell
9f106bece8 Merge "Flattenable: switch from assignment to memcpy()." am: b2356a6993
am: bb276d8555

Change-Id: I2d7317f601dcfc85705f2e71408c314de55a0f69
2016-09-23 22:53:48 +00:00
David Pursell
b2356a6993 Merge "Flattenable: switch from assignment to memcpy()." 2016-09-23 22:46:03 +00:00
Colin Cross
8e3427fb04 Merge "Move android_get_control_socket out of line" am: 4b5abcdba2 am: 4873829953
am: ea2b61c7a8

Change-Id: Ib406546b998d6d525829f0023a5f693c2e1dfd6c
2016-09-23 21:00:41 +00:00
Colin Cross
ea2b61c7a8 Merge "Move android_get_control_socket out of line" am: 4b5abcdba2
am: 4873829953

Change-Id: I45e8b86e43a47213664acf486a5de266bab6deb8
2016-09-23 20:58:40 +00:00
David Pursell
2ebce7384b Flattenable: switch from assignment to memcpy().
FlattenableUtils read() and write() currently use assignment to copy
bytes. However, by casting the void* buffer to type T, the compiler is
allowed to assume that buffer obeys the alignment requirements of T,
which is not necessarily the case during serialization. On some
architectures, we can get SIGBUS when this alignment is violated.

We don't want the users of these routines to have to worry about
alignment when packing structures, so use memcpy() instead which should
always be safe since the compiler won't assume any alignment for the
void* buffer.

On architectures that can handle unaligned direct read/write of type T,
the compiler should be smart enough to optimize this code back to a
direct read/write anyway, but architectures that can't handle it will
fall back to memcpy; this means that this change shouldn't have any
impact on current Android devices. See the linked bug for more details.

Bug: http://b/31671510
Test: libgui Sensor serialization no longer gives SIGBUS.
Test: libgui.so unchanged on Shamu before and after this CL.
Change-Id: I2197127e8cbfb43f4f553bda6464f6ebe087febd
2016-09-23 13:56:40 -07:00
Colin Cross
e8ffa449fd Move android_get_control_socket out of line
android_get_control_socket has a warning from the implicit cast from
long to int.  The warning was being hidden because cutils/sockets.h was
included with -isystem.  Move android_get_control_socket to sockets.cpp,
since we don't want header only dependencies anyways, and fix the
warning with a range check and a static_cast.

Bug: 31492149
Test: m -j <module that uses sockets.h and -Wall>
Change-Id: I1f394ab26d4ec8a7dd0e7907c10416d7f8647624
2016-09-23 11:26:08 -07:00
Colin Cross
28cda0bf38 Merge "Fix warnings in libutils headers" am: 65a1633ec3 am: 0f79b62bf6
am: 1446cbac58

Change-Id: I94a39bb24224218ef1c48080ace3455c1fc7233a
2016-09-22 23:04:13 +00:00
Colin Cross
021899fa8a Merge "Remove has_trivial_move trait from Vector<T>" am: 588b3b0c03 am: 85942090f6
am: 749181c10b

Change-Id: Ie339e0ea27463d0c5b093e9a5e262367d1ca57a5
2016-09-22 22:58:13 +00:00
Colin Cross
bd45ba6972 Merge "Fix warnings in system/ headers" am: d7f60fd871 am: 299df0bf01
am: 88fd7e2ec4

Change-Id: I94891ea3c3a00ee39b48531fcc8e5e3d6ebe724a
2016-09-22 22:52:44 +00:00
Colin Cross
1446cbac58 Merge "Fix warnings in libutils headers" am: 65a1633ec3
am: 0f79b62bf6

Change-Id: I62fea8f4ed3f2a9d16d68539eb073965531944da
2016-09-22 22:51:15 +00:00
Ajay Panicker
531b201eb6 Merge "Remove net_bt_stack group and replace it with bluetooth" am: 7875407bb7 am: f924c252bd
am: b0db9714bb

Change-Id: I025c5301fecf0566d8184efce099a195fdbfc460
2016-09-22 21:58:27 +00:00
Colin Cross
749181c10b Merge "Remove has_trivial_move trait from Vector<T>" am: 588b3b0c03
am: 85942090f6

Change-Id: Ic41410047760bff11063d12839921ae008fe7e65
2016-09-22 20:33:40 +00:00
Colin Cross
17b5b82d64 Fix warnings in libutils headers
system/core/include is included in the global include path using
-isystem, which hides all warnings.  Fix warnings in libutils
headers in preparation for moving from -isystem to -I.

- Fix implicit cast from int64_t to long in Condition.h.  Remove
  the __LP64__ check and always compare against LONG_MAX before
  casting.
- Fix implicit cast from size_t to ssize_t in KeyedVector.h
- Fix -Wshadow-field-in-constructor warnings in Looper.h and RefBase.h
- Move destructors for MessageHandler and LooperCallback to Looper.cpp
  and ReferenceRenamer and VirtualLightRefBase to RefBase.cpp to prevent
  vtables in every compilation unit.
- Declare template variables in Singleton.h
- Fix old-style casts in StrongPointer.h and TypeHelpers.h
- Use template metaprogramming in TypeHelpers.h to avoid warnings on
  memmove on non-trivial types.
- Add an assignment operator to key_value_pair_t to complete
  rule-of-three
- Use memcpy instead of dereferencing a reinterpret_casted pointer to
  treat the bits of a float or double as int32_t or int64_t
- Escape unicode sequences inside doxygen comments between \code and
  \endcode
- Remove WIN32 ZD definition in Compat.h, %zd works fine with mingw
- Fix WIN32 printf warnings in Filemap.cpp
- Initialize mNullValue with 0 in LruCache.h, some of the tests use a
  non-pointer type for TValue.

Test: m -j native
Bug: 31492149
Change-Id: I385a05a3ca01258e44fe3b37ef77e4aaff547b26
2016-09-22 13:03:15 -07:00
Colin Cross
588b3b0c03 Merge "Remove has_trivial_move trait from Vector<T>" 2016-09-22 19:44:28 +00:00
Colin Cross
097395532b Remove has_trivial_move trait from Vector<T>
Vector<T> objects are a dynamic type with a vtable, which is not
trivially moveable.

Impact on aapt for frameworks-res is negligible, ~3%.

Bug: 31595853
Test: m -j framework-res
Change-Id: I8a3269c35d95affb6e86d60588bcfca46db7f445
2016-09-22 10:14:05 -07:00
Colin Cross
88fd7e2ec4 Merge "Fix warnings in system/ headers" am: d7f60fd871
am: 299df0bf01

Change-Id: Ie6b83fdc3b97601e1021b104d4b42eec6b30bfc4
2016-09-22 11:54:20 +00:00
Ajay Panicker
b0db9714bb Merge "Remove net_bt_stack group and replace it with bluetooth" am: 7875407bb7
am: f924c252bd

Change-Id: I99e0ed5e52c71b2e41e54faf03678e57a853d140
2016-09-22 11:23:53 +00:00
Colin Cross
7673c4dc88 Merge "Hide warning in cutils/trace.h" am: 5cf3db6d2b am: a802e570b3
am: 06ec4b1352

Change-Id: If41d5b551ffe237922f4768cf403cadf7ee15887
2016-09-22 09:15:21 +00:00
Colin Cross
e84c07c832 Merge "Hide gnu extension warnings in log/log.h" am: 21049e5c91 am: 9eb3592e62
am: 4df8e4580b

Change-Id: I18d466cf45327b96856e2fb2c0ec7954a675987a
2016-09-22 09:15:06 +00:00
Treehugger Robot
d7f60fd871 Merge "Fix warnings in system/ headers" 2016-09-22 02:46:51 +00:00
Ajay Panicker
7875407bb7 Merge "Remove net_bt_stack group and replace it with bluetooth" 2016-09-22 01:32:34 +00:00
Colin Cross
06ec4b1352 Merge "Hide warning in cutils/trace.h" am: 5cf3db6d2b
am: a802e570b3

Change-Id: I216420b21d71087b2e3a5bc864f9d419270dc749
2016-09-22 01:02:40 +00:00
Colin Cross
4df8e4580b Merge "Hide gnu extension warnings in log/log.h" am: 21049e5c91
am: 9eb3592e62

Change-Id: I3c155d9b0ca9f5e87e35159e578fbe91af0ed4ec
2016-09-22 01:02:27 +00:00
Colin Cross
7c7990e6fd Fix warnings in system/ headers
system/core/include is included in the global include path using
-isystem, which hides all warnings.  Fix warnings in
system/core/include/system in preparation for moving from -isystem to -I.

- Fix invalid doxygen syntax in graphics.h
- Use a pragma to hide a C99 extension warning on the flexible length
  array in graphics.h
- Make static functions in radio.h static inline
- Fix size_t printf and size_t vs. ssize_t comparision in qemu_pipe.h
- Fix old style cast in window.h

Test: m -j native
Bug: 31492149
Change-Id: I857f289e4c8e303494831873282bbb69de155c10
2016-09-21 17:46:59 -07:00
Colin Cross
5cf3db6d2b Merge "Hide warning in cutils/trace.h" 2016-09-22 00:46:13 +00:00
Colin Cross
9993e799f1 Hide warning in cutils/trace.h
system/core/include is included in the global include path using
-isystem, which hides all warnings.  cutils/trace.h has an ignored
return value warning, move the implementation to trace-dev.c so it
doesn't cause warnings in every module that includes it in preparation
for moving from -isystem to -I.

Test: m -j native
Bug: 31492149
Change-Id: If8b3fe13059c9e59c2d5208294d427d84fa6e588
2016-09-21 17:45:31 -07:00
Colin Cross
21049e5c91 Merge "Hide gnu extension warnings in log/log.h" 2016-09-22 00:45:02 +00:00
Ajay Panicker
604208e957 Remove net_bt_stack group and replace it with bluetooth
Bug: 31549206
Change-Id: I667963e5f9fd1a5dc9ad74378b318e3b782e6883
2016-09-20 12:01:33 -07:00
Colin Cross
bcedc20a2e Merge "Fix warnings in libziparchive" am: 91811d2d34 am: 6f5edc78d8
am: e3d8246c0b

Change-Id: I4737599a4245d4ed1b8c6c77ff939fee1e206f86
2016-09-20 18:47:46 +00:00
Colin Cross
e3d8246c0b Merge "Fix warnings in libziparchive" am: 91811d2d34
am: 6f5edc78d8

Change-Id: I3f2869a94cebaf86647443bdc7a2f3520e5dd555
2016-09-20 18:37:19 +00:00
Colin Cross
7c6c7f0b9f Fix warnings in libziparchive
system/core/include is included in the global include path using
-isystem, which hides all warnings.  zlib.h is included through
system/core/include/ziparchive/zip_archive.h, which was hiding warnings
in it.  Use a #pragma around the call to deflateInit2, it is a macro
that expands to an old-style cast, in preparation for moving from
-isystem to -I.  Also move the ZipString constructor to zip_archive.cc
so it can assert on the length of the string parameter and fix an
implicit conversion from size_t to uint16_t.

Test: m -j native
Bug: 31492149
Change-Id: I74cdad7fe9c723859b5cfbea73c8f27d9d9ca265
2016-09-20 09:23:47 -07:00
Elliott Hughes
c6dd9aaf5c Move libusbhost's headers into libusbhost. am: e0a7c773ed am: d141edfb3c
am: 1cde9655bb

Change-Id: I2df83b58943ca2ffe3f82ba7199ae85976f169c8
2016-09-17 01:43:40 +00:00
Elliott Hughes
1cde9655bb Move libusbhost's headers into libusbhost. am: e0a7c773ed
am: d141edfb3c

Change-Id: I3eed13355c67ff09b6f61aee5b6329ec15ce8b21
2016-09-17 01:41:09 +00:00
Elliott Hughes
d141edfb3c Move libusbhost's headers into libusbhost.
am: e0a7c773ed

Change-Id: Ia6b0131c9405650a8c9934a7010c7723f028f6dd
2016-09-17 01:38:39 +00:00
Treehugger Robot
36b88ce975 Merge "Move libusbhost's headers into libusbhost." 2016-09-17 01:33:11 +00:00
Colin Cross
3b7524fe3a Merge "Fix warnings in cutils/atomic.h" am: 5e093f367c am: 6f292bcab9
am: a205ed0aad

Change-Id: I03b1bcf695452b7f0322aaa166c2fe64fc0b49bb
2016-09-16 20:08:56 +00:00
Colin Cross
a205ed0aad Merge "Fix warnings in cutils/atomic.h" am: 5e093f367c
am: 6f292bcab9

Change-Id: I69dc6ea6ec78f48710be69e287f1610726894466
2016-09-16 19:47:31 +00:00
Treehugger Robot
5e093f367c Merge "Fix warnings in cutils/atomic.h" 2016-09-16 19:31:10 +00:00
Colin Cross
412ad0dad8 Hide gnu extension warnings in log/log.h
system/core/include is included in the global include path using
-isystem, which hides all warnings.  Fix warnings in log/log.h
in preparation for moving from -isystem to -I.

log/log.h uses gnu extensions for zero-argument variadic macro token
pasting, which clang warns about with -Weverything.  Hide the warnings
using pragmas.

Test: m -j native
Bug: 31492149
Change-Id: Ib2113f877d811a6ecc0e91c035640b506f04bd86
2016-09-16 11:13:20 -07:00
Elliott Hughes
ab273a5a4b Move libbinderwrapper's headers into libbinderwrapper. am: 40104501fa am: c5cc029993
am: 761c529b37

Change-Id: Iabb74f1a8ea0c79821b2ee3efbfce4bfbccbac13
2016-09-16 18:04:57 +00:00
Elliott Hughes
761c529b37 Move libbinderwrapper's headers into libbinderwrapper. am: 40104501fa
am: c5cc029993

Change-Id: I351680f306d7fb8814f8b41eb9e895a1a4153827
2016-09-16 17:51:24 +00:00
Elliott Hughes
e0a7c773ed Move libusbhost's headers into libusbhost.
Change-Id: Ic5ff65bd6456ea3cc92e0c8f9d7a6f499e58dbfc
2016-09-16 10:43:56 -07:00
Elliott Hughes
40104501fa Move libbinderwrapper's headers into libbinderwrapper.
It was probably the LOCAL_EXPORT_C_INCLUDE_DIRS that made me miss this on the
original code review...

Change-Id: I55bc0b0698604338cd206bf5f336798929b6d8f9
2016-09-16 09:02:47 -07:00
Colin Cross
ec69c05463 Fix warnings in cutils/atomic.h
system/core/include is included in the global include path using
-isystem, which hides all warnings.  Fix warnings in cutils/atomic.h in
preparation for moving from -isystem to -I.

Test: m -j native
Bug: 31492149
Change-Id: I2a212f192309090a16d507e9ab6acf0fd7cac02d
2016-09-15 19:22:32 -07:00
Courtney Goeltzenleuchter
7ae63a8cbd Add color mode enums am: a2e874eabc
am: ae93122c0e

Change-Id: Ifaef323f9804c36ca5271fd3eafcef75cf67e9c5
2016-09-09 18:47:13 +00:00
Lajos Molnar
ef8322329e add android_flex_layout for describing all flexible formats. am: 0e10df4dd6
am: a2d46813fc

Change-Id: I47fbc1c78ac1458150d5231a85b4cf5c3e17a62f
2016-09-09 18:47:07 +00:00
Courtney Goeltzenleuchter
a2e874eabc Add color mode enums
The android_color_mode_t defines the color modes supported
by a display. A display can support multiple different
color modes.

sRGB mode and AdobeRGB are deliberately placed at 7 and 8
so that they match mode ID's used on prior devices.

bug: http://b/27926012
Change-Id: I9ab41b56ec0b495c02539665da5be158ffddf843
2016-09-08 11:39:32 -07:00
Lajos Molnar
0e10df4dd6 add android_flex_layout for describing all flexible formats.
Bug: 22767098
Bug: 24759202
Change-Id: I61e4ca9bd71e8da88a9571ec4effc7165026715b
2016-09-08 11:38:53 -07:00
Felipe Leme
c561b35f29 Added a NETWORK trace tag. am: 785735bde1
am: 860f100454

Change-Id: I729a74de3a1da6cbf176e33dfda253ac47d4dfd8
2016-09-08 00:44:48 +00:00
Felipe Leme
785735bde1 Added a NETWORK trace tag.
BUG: 31281543
Change-Id: I4d7c7fc26c77fec099bbf0f9426e3a9f3a722e6d
2016-09-07 12:47:18 -07:00
Mark Salyzyn
2fb3f08d51 liblog: add __android_log_close()
Bug: 30963384

(cherry picked from commit df7a4c6bae)

Change-Id: Iee7cd0db819644299fa086586630e71415643294
2016-08-30 16:02:08 +01:00
Christopher Ferris
0c572d01af Fix race condition updating local map data.
If the underlying local map changes, it's possible for multiple
threads to try and modify the map data associated with the UnwindLocalMap
object. Add a lock when generating the local map to avoid this problem.

In addition, add a read lock whenever any caller gets the maps iterator.
Updated all iterator callers to make this lock.

Bug: 29387050
Bug: 31067025

(cherry picked from commit 3a14004c7f)

Change-Id: Id00116f156a24b36085c0d5dfc3dde4d2ac55194
2016-08-25 15:01:53 -07:00
Martijn Coenen
111ef54a28 Merge changes from topic 'utf' am: 3a07e5bf94 am: aa7fd8a3ec
am: ade3876260

Change-Id: Ifec806c7553b36a6502a8b5bb3dec559c117f4cc
2016-08-25 20:31:42 +00:00
Martijn Coenen
ade3876260 Merge changes from topic 'utf' am: 3a07e5bf94
am: aa7fd8a3ec

Change-Id: I3c90317d492a84ff99b18463d6f489e7b1cca61b
2016-08-25 20:24: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
Hans Boehm
2d3545fe82 Merge "Make RefBase more robust and debuggable" am: daac359be7 am: 7bf3d21fde
am: 7dddf9433c

Change-Id: Ia8bdef250b29d964a9ab07c450da31a368bb3143
2016-08-24 23:52:14 +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
daac359be7 Merge "Make RefBase more robust and debuggable" 2016-08-24 23:36:13 +00:00
Andy Hung
8ec6753d61 Fix Mutex::timedLock to properly handle relative time am: 604ba48220 am: 708b9d118a
am: 47e5ca61e2

Change-Id: I5c351fbdc485acbcb33426b99ea6b900519ee0e3
2016-08-24 22:50:00 +00:00
Andy Hung
604ba48220 Fix Mutex::timedLock to properly handle relative time
Bug: 31008450
Change-Id: Ie6c17e17b7a8c3d8a087c47be535e9d04f285380
2016-08-24 22:29:11 +00:00
Mark Salyzyn
e5bda4d0ec Merge "liblog: add __android_log_close()" am: 812d1c7ea2 am: 6322efe522
am: ed421af68d

Change-Id: Ifacd3de810c30a9b79cb262ab4c2432d8b1c0791
2016-08-24 16:10:09 +00:00
Mark Salyzyn
af3623281f Merge "logger: validate hdr_size field in logger entry" am: fcf7ab8b1b am: 2d562c9dce
am: 098b5887c6

Change-Id: I4d067039a766e7079a91eb56d2ffb8d68aba58b5
2016-08-24 16:10:08 +00:00
Mark Salyzyn
ed421af68d Merge "liblog: add __android_log_close()" am: 812d1c7ea2
am: 6322efe522

Change-Id: Ib61d4ec5102fcfb12c48250c019fcdf019c2ffc5
2016-08-24 16:07:39 +00:00
Mark Salyzyn
098b5887c6 Merge "logger: validate hdr_size field in logger entry" am: fcf7ab8b1b
am: 2d562c9dce

Change-Id: I5721e8614079a04c2dc364304d0ffed10d74be90
2016-08-24 16:07:38 +00: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
8e5cb037c4 Merge "libcutils: Add ashmem_valid() function" am: d00c7470ea am: 8b1f7b595c
am: da07f7880c

Change-Id: I3a4cf9a2cd848aae04ec3e88ae1e50a51774cd5f
2016-08-24 15:54:08 +00:00
Mark Salyzyn
da07f7880c Merge "libcutils: Add ashmem_valid() function" am: d00c7470ea
am: 8b1f7b595c

Change-Id: I1be0fc5d74c609ec42578c29c7af9d897708f8c6
2016-08-24 15:51:08 +00:00
Mark Salyzyn
8b1f7b595c Merge "libcutils: Add ashmem_valid() function"
am: d00c7470ea

Change-Id: Ib09d3ee7bb131c30f59ea273f357c045394206fb
2016-08-24 15:48:55 +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
Connor O'Brien
7d7f5399d4 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a am: b906ad88b9 am: 2fadbb93a4 am: e04054d9bb am: 9745b11db1 am: 2f78b2c3d6 am: 2b5e6d8ffc am: 2427a462c0 am: 6b155c1cc4 am: 2f16eeede6
am: 233c9902cf

Change-Id: Idc2f2b967a890489769cda203d8ed7b73eb6a303
2016-08-19 22:57:38 +00:00
Connor O'Brien
233c9902cf Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a am: b906ad88b9 am: 2fadbb93a4 am: e04054d9bb am: 9745b11db1 am: 2f78b2c3d6 am: 2b5e6d8ffc am: 2427a462c0 am: 6b155c1cc4
am: 2f16eeede6

Change-Id: I3d2fdfc10f91080ca32aa6557b13391355427edc
2016-08-19 22:53:32 +00:00
Connor O'Brien
af8d67e032 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a am: b906ad88b9 am: 2fadbb93a4 am: e04054d9bb am: 9745b11db1 am: 2f78b2c3d6 am: 2b5e6d8ffc am: 2427a462c0 am: 6b155c1cc4
am: 2f16eeede6

Change-Id: I272469151a3680acfc2203a0f3aac79a319a1d06
2016-08-19 22:53:32 +00:00
Connor O'Brien
2f16eeede6 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a am: b906ad88b9 am: 2fadbb93a4 am: e04054d9bb am: 9745b11db1 am: 2f78b2c3d6 am: 2b5e6d8ffc am: 2427a462c0
am: 6b155c1cc4

Change-Id: Ie6c2bcee1deacb94259a6153097757674fa19251
2016-08-19 22:50:00 +00:00
Connor O'Brien
2f78b2c3d6 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a am: b906ad88b9 am: 2fadbb93a4 am: e04054d9bb
am: 9745b11db1

Change-Id: I61f685976803f51db9ba85729554fc14efaa4b2c
2016-08-19 22:36:29 +00:00
Connor O'Brien
9745b11db1 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a am: b906ad88b9 am: 2fadbb93a4
am: e04054d9bb

Change-Id: Ia5f46e5b9622946ca0e44fbe7399729807d2d08a
2016-08-19 22:34:46 +00:00
Connor O'Brien
2fadbb93a4 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c am: 109024f74a
am: b906ad88b9

Change-Id: Ida2b33bd1db284dfa8ad3f130219481a92785e97
2016-08-19 22:14:57 +00:00
Connor O'Brien
b906ad88b9 Fix vold vulnerability in FrameworkListener am: 470484d2a2 am: e9e046df6c
am: 109024f74a

Change-Id: Ia6e8dca36bc28d442a6e374ecf033b79176f4b93
2016-08-19 22:11:27 +00:00
Connor O'Brien
109024f74a Fix vold vulnerability in FrameworkListener am: 470484d2a2
am: e9e046df6c

Change-Id: I8f2452782817ddf03051af08e70ba9d4c4fa578a
2016-08-19 22:08:22 +00:00
Connor O'Brien
470484d2a2 Fix vold vulnerability in FrameworkListener
Modify FrameworkListener to ignore commands that exceed the maximum
buffer length and send an error message.

Bug: 29831647
Change-Id: I9e57d1648d55af2ca0191bb47868e375ecc26950
Signed-off-by: Connor O'Brien <connoro@google.com>
(cherry picked from commit baa126dc15)
2016-08-19 17:05:25 +00:00
Dmitriy Filchenko
ceca7afbc7 Merge "Remove process_name.c" am: e5b7ad1c39 am: 97e3cb7074
am: de9e6fb4b0

Change-Id: I402ab55567532786d61412e7c567e2da5fbc800b
2016-08-19 01:36:31 +00:00
Dmitriy Filchenko
de9e6fb4b0 Merge "Remove process_name.c" am: e5b7ad1c39
am: 97e3cb7074

Change-Id: I8ddeceadedd4ca689d96f3a854ba34f31d16683f
2016-08-19 01:33:31 +00:00
Dmitriy Filchenko
97e3cb7074 Merge "Remove process_name.c"
am: e5b7ad1c39

Change-Id: I8f98f5fe9ff526ed8780971eddef128ed46de271
2016-08-19 01:30:34 +00:00
Dmitriy Filchenko
1bb49f483b Remove process_name.c
BUG: 29824203

Change-Id: I88d67cafb8ec0c4eea3db047bac0671de698ba02
2016-08-18 23:54:46 +00:00
Hans Boehm
23c857ebd6 Make RefBase more robust and debuggable
This prevents two different kinds of client errors from causing
undetected memory corruption, and helps with the detection of others:

1. We no longer deallocate objects when the weak count goes to zero
and there have been no strong references.  This otherwise causes
us to return a garbage object from a constructor if the constructor
allocates and deallocates a weak pointer to this. And we do know
that clients allocate such weak pointers in constructors and their
lifetime is hard to trace.

2. We abort if a RefBase object is explicitly destroyed while
the weak count is nonzero.  Otherwise a subsequent decrement
would cause a write to potentially reallocated memory.

3. We check counter values returned by atomic decrements for
plausibility, and fail immediately if they are not plausible.

We unconditionally log any cases in which 1 changes behavior
from before. We abort in cases in which 2 changes behavior, since
those reflect clear bugs.
In case 1, a log message now indicates a possible leak. We have
not seen such a message in practice.

The third point introduces a small amount of overhead into the
reference count decrement path. But this should be negligible
compared to the actual decrement cost.

Add a test for promote/attemptIncStrong that tries to check for
both (1) above and concurrent operation of attemptIncStrong.

Add some additional warnings and explanations to the RefBase
documentation.

Bug: 30503444
Bug: 30292291
Bug: 30292538

Change-Id: Ida92b9a2e247f543a948a75d221fbc0038dea66c
2016-08-13 11:17:51 -07:00
Hans Boehm
e725c79831 Merge "Improve RefBase documentation, especially for clients." am: 0f39fe22ae am: df6c464e9a
am: f997434b06

Change-Id: I6eb6670d6b73c9a77a56294a9bdca9229bdc98a3
2016-08-10 16:29:59 +00:00
Hans Boehm
f997434b06 Merge "Improve RefBase documentation, especially for clients." am: 0f39fe22ae
am: df6c464e9a

Change-Id: I8fa12835ff648d78c68265facb5b63ca7b1eab6a
2016-08-10 16:26:59 +00:00
Hans Boehm
df6c464e9a Merge "Improve RefBase documentation, especially for clients."
am: 0f39fe22ae

Change-Id: I804989b192142dc9d69ca36f0122079822625e7e
2016-08-10 16:24:01 +00:00
Hans Boehm
0f39fe22ae Merge "Improve RefBase documentation, especially for clients." 2016-08-10 16:16:22 +00:00
Hans Boehm
9ba7192c1f Improve RefBase documentation, especially for clients.
Add basic interface documentation to RefBase.h.

Much, but not all, of this is cut-and-pasted from an email message
from Mathias Agopian. The rest is reconstructed from the code.

Delete some, now redundant, text from Refbase.cpp, and add a bit
more about the implementation strategy.

Some minor fixes to internal comments.

Bug: 30292291
Change-Id: I56518ae5553bc6de0cc2331778e7fcf2e6c4fd87
2016-08-09 15:12:19 -07:00
Chih-Hung Hsieh
d8ced2029b Merge "Fix google-explicit-constructor warnings in utils." am: 5b7e3b9a2a am: 4d031d6358
am: e1fff2572c

Change-Id: I5c75363a555fd31aa587ca7cb5905e928148a19f
2016-08-04 21:53:19 +00:00
Chih-Hung Hsieh
e1fff2572c Merge "Fix google-explicit-constructor warnings in utils." am: 5b7e3b9a2a
am: 4d031d6358

Change-Id: I89352ced43afd415aefe2b8e45dd9fdd76dc0551
2016-08-04 21:51:20 +00:00
Chih-Hung Hsieh
4d031d6358 Merge "Fix google-explicit-constructor warnings in utils."
am: 5b7e3b9a2a

Change-Id: I88b7d5f20f26a028c90efdb837730e5b8631ce80
2016-08-04 21:48:20 +00:00
Chih-Hung Hsieh
2a929968e1 Fix google-explicit-constructor warnings in utils.
* Declare explicit conversion constructors.
* Use NOLINT(implicit) for implicit conversion constructors.

Bug: 28341362
Change-Id: I4fb58fa32aafc520b2ed862a05a8bdbfabbc6c35
Test: build with WITH_TIDY=1
2016-08-02 12:20:06 -07:00
Sergio Giro
8cb6b11176 Merge \\\"LruCache: avoid copying keys in lookup\\\" am: 896c6b14ae am: 4476929073
am: d20120ae1f

Change-Id: I5e9e9966272d853e8ab56c763e9e6c8399e4b911
2016-07-20 19:53:40 +00:00
Sergio Giro
d20120ae1f Merge \\"LruCache: avoid copying keys in lookup\\" am: 896c6b14ae
am: 4476929073

Change-Id: I3c49a22c68c8a66c912f08e3b7cdd8340de69532
2016-07-20 19:51:07 +00:00
Sergio Giro
4476929073 Merge \"LruCache: avoid copying keys in lookup\"
am: 896c6b14ae

Change-Id: If8223e90988510385378506cd3a05d382ab73fc9
2016-07-20 19:48:44 +00:00
Sergio Giro
896c6b14ae Merge "LruCache: avoid copying keys in lookup" 2016-07-20 19:38:47 +00:00
Sergio Giro
4c56e0a222 LruCache: avoid copying keys in lookup
Create objects of type KeyedEntry for lookups that only have
a key reference

Bug: 27567036
Change-Id: I5e609a3db63d3b9277ff1547a3cca37dce70251c
2016-07-20 18:38:44 +00:00
Elliott Hughes
f58dc88f56 Merge \\\"Remove no-op klog_init.\\\" am: 5558cd362b am: 8932be864d
am: 30fc292a26

Change-Id: Ie40c73c1593e06392d042eb855b8bcb678d59b30
2016-07-19 19:54:04 +00:00
Elliott Hughes
30fc292a26 Merge \\"Remove no-op klog_init.\\" am: 5558cd362b
am: 8932be864d

Change-Id: I90466cd911100735e7c8ec88fd5d680b5ae9d8fe
2016-07-19 19:51:09 +00:00
Elliott Hughes
8932be864d Merge \"Remove no-op klog_init.\"
am: 5558cd362b

Change-Id: I3f2112bead6740f1df48bc5b028f62c91d40425b
2016-07-19 19:48:36 +00:00
Elliott Hughes
489e3fbaa0 Remove no-op klog_init.
Change-Id: I467edad1d004ac16647f4aa1f0eead04e808efa0
2016-07-19 11:45:36 -07:00
Robert Sesek
d257784aee Merge \\\"Add static UID for the webview zygote process.\\\" am: 07f5d8cc0c am: ed1c074303
am: 15166f96d9

Change-Id: I36aba1b85750e81f956b29d3ab2742f7fa9e49a4
2016-07-15 21:12:25 +00:00
Robert Sesek
15166f96d9 Merge \\"Add static UID for the webview zygote process.\\" am: 07f5d8cc0c
am: ed1c074303

Change-Id: Ie411759bd011b424d619e3949e29e1fdaf08ba91
2016-07-15 21:08:54 +00:00
Robert Sesek
ed1c074303 Merge \"Add static UID for the webview zygote process.\"
am: 07f5d8cc0c

Change-Id: I7d2382f3e61a405a9b838b02983aa8dbf9aedc74
2016-07-15 21:05:25 +00:00
Treehugger Robot
07f5d8cc0c Merge "Add static UID for the webview zygote process." 2016-07-15 20:58:50 +00:00
Sergio Giro
71d9f83fa9 Merge \"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\" into nyc-dev
am: 757f4ef340

Change-Id: I29dfaa3968597fc3b0cdadd140b5790c1e61008d
2016-07-14 18:08:00 +00:00
Sergio Giro
28f28ce635 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 2806397d1e
am: 8c9d02551c

Change-Id: Ia8754c27d2d2a639280235c2dbf9043f3442421e
2016-07-14 17:59:56 +00:00
Sergio Giro
2806397d1e DO NOT MERGE 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.

(cherry picked from commit c4966a363e)

Change-Id: Idfb0eb29b305678608586d25c2f372146569ad39
Bug: 29250543
2016-07-14 17:25:27 +00:00
Sergio Giro
3411dd4457 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-07-14 16:49:50 +01:00
Sergio Giro
b022447a3a DO NOT MERGE 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.

(cherry picked from commit c4966a363e)

Change-Id: Idfb0eb29b305678608586d25c2f372146569ad39
Bug: 29250543
2016-07-14 14:47:59 +00:00
Sergio Giro
570dbfb8b8 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-07-14 13:40:43 +00:00
Sergio Giro
3841c92912 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6
am: d0ad14ca21

Change-Id: Id0901a86ea469d664badfee75db32948c88e72f7
2016-07-14 12:55:58 +00:00
Sergio Giro
5fce0542b6 DO NOT MERGE 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.

(cherry picked from commit c4966a363e)

Bug: 29250543
Change-Id: Ia2d6a550f5594280505fb0835c752e53898700ed
2016-07-14 12:34:30 +00:00
Sergio Giro
e059f5e325 Revert \\\\\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d am: 605de74373 am: 37826f5613 am: 80473d5d33
am: c06d338ad7

Change-Id: I4ee28f7eb936464eeee476b9fedb19aa7fb96ac0
2016-07-13 13:01:47 +00:00
Sergio Giro
c06d338ad7 Revert \\\\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d am: 605de74373 am: 37826f5613
am: 80473d5d33

Change-Id: Ia5cb6e89924e69df568d633472656dd4b0c12a76
2016-07-13 12:58:09 +00:00
Sergio Giro
37826f5613 Revert \\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d
am: 605de74373

Change-Id: Ib58bd045e59fcfcf449b346861b5427d07fba9c6
2016-07-13 12:51:06 +00:00
Sergio Giro
605de74373 Revert \\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\" am: 311002936e am: ddd0051968
am: b218b2d34d

Change-Id: Iced8e47993a39103aed3deafb5deb974995ecdba
2016-07-13 12:47:25 +00:00
Sergio Giro
b218b2d34d Revert \\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\" am: 311002936e
am: ddd0051968

Change-Id: Ia2a422c170a0d700a1d4d55ea920361689a9be8b
2016-07-13 12:44:00 +00:00
Sergio Giro
311002936e Revert "libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8"
This reverts commit 53473c1607.

Change-Id: I27379317e08ecbd5e3b95b7ece58194838ab6c21
2016-07-13 11:47:53 +00:00
Sergio Giro
6025b216e4 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607 am: 41e6690d0c am: 29ccafe5f0 am: fd7bd2dfef am: 498ffa62c5 am: 5e4ebd02d4
am: d837e74381

Change-Id: Ie620548a78c92d2160db4395f00c6ec9f281e937
2016-07-13 09:55:54 +00:00
Sergio Giro
d837e74381 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607 am: 41e6690d0c am: 29ccafe5f0 am: fd7bd2dfef am: 498ffa62c5
am: 5e4ebd02d4

Change-Id: Ib2eb019edba21cd3ba3e22d745818d30c912ce62
2016-07-13 09:52:14 +00:00
Sergio Giro
498ffa62c5 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607 am: 41e6690d0c am: 29ccafe5f0
am: fd7bd2dfef

Change-Id: I24df8d8b13987ea0f99be6d4e9f49d52a1c4f58b
2016-07-13 09:44:52 +00:00
Sergio Giro
fd7bd2dfef libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607 am: 41e6690d0c
am: 29ccafe5f0

Change-Id: If7c24750afcae3a4b73885b2c4fb9b99ffca5c45
2016-07-13 09:41:12 +00:00
Sergio Giro
29ccafe5f0 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607
am: 41e6690d0c

Change-Id: I0f7707c88684f9cc24fff878d3d3751b6025227f
2016-07-13 09:37:36 +00:00
Sergio Giro
53473c1607 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.

(cherry picked from commit c4966a363e)
(changed code for safetynet logging due to lack of sstream and string in klp)

Change-Id: If50d59a91a13fddbff9a8fff0d3eebe57c711e93
Bug: 29250543
2016-07-12 18:39:11 +01:00
Greg Kaiser
e3d5dfb514 Merge \\\"RefBase: Silence compiler warnings\\\" am: f76ca2a43b am: 3b43562535
am: 0c9b9ec4dc

Change-Id: I5ad8747c490bf655ced9f58ecfec2e9c3ed8c436
2016-07-12 00:18:06 +00:00
Greg Kaiser
3b43562535 Merge \"RefBase: Silence compiler warnings\"
am: f76ca2a43b

Change-Id: I4a146e36db49fc336baa7a59f8fbea0ca1dbb084
2016-07-12 00:15:19 +00:00
Treehugger Robot
f76ca2a43b Merge "RefBase: Silence compiler warnings" 2016-07-12 00:10:24 +00:00
Greg Kaiser
d9885e7edb RefBase: Silence compiler warnings
We comment out the names of the parameters we're intentionally
not using.

(cherrypick of 44a0eb4d8cdf4ab881f5d5a1acc1155266a46f6a.)

Change-Id: I0a92d9200ca26cdc4700d2ff9e3ab33c102520d5
2016-07-11 16:11:30 -07:00
Robert Sesek
e782a44575 Add static UID for the webview zygote process.
This UID will never own any files.

Bug: 21643067
Change-Id: Ifc887b1033ed4564336c8552012fb6bd0de73c15
2016-07-11 12:39:55 -04:00
Sergio Giro
502602366c Merge \"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\" into nyc-mr1-dev
am: 7714abac6b

Change-Id: I63e0299219dc1e50b31a88384fed7f3f43e9f86e
2016-07-11 12:22:43 +00:00
Sergio Giro
7714abac6b Merge "libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8" into nyc-mr1-dev 2016-07-11 12:11:32 +00:00
Sergio Giro
c4966a363e 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
2016-07-11 09:46:32 +00:00
Elliott Hughes
6605b0b23a Merge \\\"Make klog_fd thread-safe and make klog_init a no-op.\\\" am: 588b770063 am: 73d363bbc1
am: 7288ac3982

Change-Id: I46bbcb64eecc01ec7bd8bb502237c1b9057befc4
2016-07-08 17:12:48 +00:00
Elliott Hughes
73d363bbc1 Merge \"Make klog_fd thread-safe and make klog_init a no-op.\"
am: 588b770063

Change-Id: I884276a8f8b8209f6e956c5fb410e8265184e1b5
2016-07-08 17:05:25 +00:00
Elliott Hughes
588b770063 Merge "Make klog_fd thread-safe and make klog_init a no-op." 2016-07-08 17:01:13 +00:00
Erik Kline
5f7ecd953a Merge \\\"Add UIDs for system DNS and tethering DNS\\\" am: c4dc4f3fc2 am: fcf3ed51dc
am: 9f31416013

Change-Id: I2ad186412133603a36d91801737d15d4441d4956
2016-07-08 08:55:14 +00:00
Erik Kline
3c2e2f4d5e Add UIDs for system DNS and tethering DNS
Bug: 29420831
Bug: 29881876
Change-Id: I7a48f980f0e52a3d322c4c02988d48fc6df643ca
(cherry picked from commit d63cf7d85a)
2016-07-08 17:49:40 +09:00
Erik Kline
fcf3ed51dc Merge \"Add UIDs for system DNS and tethering DNS\"
am: c4dc4f3fc2

Change-Id: I40d246a3d4c293797ae5204cebd61b50c4021205
2016-07-08 08:48:11 +00:00
Treehugger Robot
c4dc4f3fc2 Merge "Add UIDs for system DNS and tethering DNS" 2016-07-08 08:43:55 +00:00
Mark Salyzyn
6a70a53235 Merge \\\"logcat: format verbs and adverbs\\\" am: 82fb012a03 am: b13d0ce160
am: b6dbe28746

Change-Id: I277fbcebeeffd237adf63831be715eabfaf8d758
2016-07-06 20:36:27 +00:00
Mark Salyzyn
b13d0ce160 Merge \"logcat: format verbs and adverbs\"
am: 82fb012a03

Change-Id: I1f897abc493f63195fff505c37746ee9e82cfac1
2016-07-06 20:27:29 +00:00
Mark Salyzyn
9cfd1c6ebc logcat: format verbs and adverbs
Bug: 29916087
Change-Id: I039c95b9dc0aa88f1219121513899934381453ae
2016-07-06 11:16:07 -07:00
Dan Stoza
5d636e830f NativeWindow: Add LAST_[DE]QUEUE_DURATION queries
am: 94ededa387

Change-Id: I4fb6c849cf97dcd70cc7b7345e230238870e7d3a
2016-07-06 16:27:37 +00:00
Erik Kline
d63cf7d85a Add UIDs for system DNS and tethering DNS
Bug: 29420831
Bug: 29881876
Change-Id: I7a48f980f0e52a3d322c4c02988d48fc6df643ca
2016-07-06 11:13:59 +09:00
Dan Stoza
94ededa387 NativeWindow: Add LAST_[DE]QUEUE_DURATION queries
Adds two new enums to enable querying the duration of the last
dequeue or queue operations to a Surface/ANativeWindow.

Bug: 29413700
Change-Id: Ifa16755911c4a3c013a7128dd4038d328109c32d
2016-07-01 16:07:00 -07:00
Elliott Hughes
171a829c39 Make klog_fd thread-safe and make klog_init a no-op.
I'll come back and remove klog_init when I've removed other calls to it.

Change-Id: Iad7fd26d853b4ddc54e9abd44516b6f138cbbfcb
Test: booted N9, looked at "adb shell dmesg" output.
2016-06-29 16:16:41 -07:00
Courtney Goeltzenleuchter
b7d9991277 Add color mode enums
am: bf8132a7c1

Change-Id: I9fcf65efe519cc41358f5031741b5c4d3024cd9f
2016-06-22 00:18:20 +00:00
Courtney Goeltzenleuchter
bf8132a7c1 Add color mode enums
The android_color_mode_t defines the color modes supported
by a display. A display can support multiple different
color modes.

sRGB mode and AdobeRGB are deliberately placed at 7 and 8
so that they match mode ID's used on prior devices.

bug: http://b/27926012
Change-Id: I9ab41b56ec0b495c02539665da5be158ffddf843
2016-06-21 14:47:23 -06:00
David 'Digit' Turner
3a72d0fc79 Merge \\\"[qemu]: Move qemu_pipe.h from include/system/ directory.\\\" am: 44b7339aa2 am: 1c01bae82a
am: 6bcf0cf1e7

Change-Id: I85589757feb3aac19469afd97b8e98a74373acab
2016-06-21 08:10:38 +00:00
David 'Digit' Turner
1c01bae82a Merge \"[qemu]: Move qemu_pipe.h from include/system/ directory.\"
am: 44b7339aa2

Change-Id: I59b9a896058dea76f69b9ba757890d4a42952a66
2016-06-21 08:05:18 +00:00
David Turner
44b7339aa2 Merge "[qemu]: Move qemu_pipe.h from include/system/ directory." 2016-06-21 07:38:02 +00:00
Elliott Hughes
9f240487dd Merge \\\"Use __ with attribute __noreturn__ to avoid colliding with noreturn.\\\" am: e0dfd2a00e am: a1d9edfbf3
am: 95bafa7cdd

Change-Id: Icd04c56368113feb86d1cf9d66a1e04124e5ef58
2016-06-21 02:12:01 +00:00
Elliott Hughes
a1d9edfbf3 Merge \"Use __ with attribute __noreturn__ to avoid colliding with noreturn.\"
am: e0dfd2a00e

Change-Id: I93779cd1785db5d277df21dffe1896edd40df7fb
2016-06-21 02:02:25 +00:00
Treehugger Robot
e0dfd2a00e Merge "Use __ with attribute __noreturn__ to avoid colliding with noreturn." 2016-06-21 01:52:04 +00:00
Elliott Hughes
665051ca63 Use __ with attribute __noreturn__ to avoid colliding with noreturn.
Change-Id: I5a73ec69b580b2e70b2c68177078fa56b8353c19
2016-06-20 17:21:59 -07:00
Josh Gao
fd94eae2e4 Merge changes from topic \\\'debuggerd_client\\\' am: abf88685e3 am: 88347e1430
am: 48915ad5e0

Change-Id: I48668c7a5c36b8786b919eb19c30fdcb2b3e417c
2016-06-20 20:52:41 +00:00
Josh Gao
88347e1430 Merge changes from topic \'debuggerd_client\'
am: abf88685e3

Change-Id: I2a61e4e8b5ec5a4ab6566ab4f8eb31653255fbc5
2016-06-20 20:47:18 +00:00
Treehugger Robot
abf88685e3 Merge changes from topic 'debuggerd_client'
* changes:
  adb: use libdebuggerd_client.
  debuggerd: add libdebuggerd_client.
2016-06-20 20:22:18 +00:00
Christopher Ferris
7d14cf44f3 Merge \\\"Fix race condition updating local map data.\\\" am: 863d8e11b9 am: e1eb2272d6
am: 942c77793f

Change-Id: I062600c36ff36e810e4749475702a232fd13b446
2016-06-18 00:13:58 +00:00
Christopher Ferris
e1eb2272d6 Merge \"Fix race condition updating local map data.\"
am: 863d8e11b9

Change-Id: I00899ce500c2ae8bc58b6eb42c01d8688dd232c0
2016-06-18 00:05:26 +00:00
Josh Gao
9c02dc5916 debuggerd: add libdebuggerd_client.
Bug: http://b/24414818
Change-Id: I079c534d2c952b6975bf0428eb86cc7a55525737
2016-06-17 13:11:29 -07:00
David 'Digit' Turner
c7b098ceb5 [qemu]: Move qemu_pipe.h from include/system/ directory.
The <hardware/qemu_pipe.h> header isn't related to any loadable
hardware module, this patch thus relocates it to <system/qemu_pipe.h>
which is a much more logical location.

Note the following changes:

  - The pipe name must begin with the 'pipe:' prefix to avoid an
    un-necessary snprintf() and buffer copy.

  - Does not probe for the obsolete /dev/goldfish_pipe device, i.e.
    only use /dev/qemu_pipe instead.

  - Use QEMU_PIPE_DEBUG() instead of D() as the debugging macro.

+ Update ADB to use the newest <system/qemu_pipe.h>

+ Add qemu_pipe_frame_send() and qemu_pipe_frame_recv() utility
  functions which replace the obsolete qemud_channel_send() and
  qemud_channel_recv() from the defunct <hardware/qemud.h>
  header.

BUG=25875346

Change-Id: Ic290a5b79d466c2af64b49bd9134643277c11bfd
2016-06-17 09:21:59 +02:00
Christopher Ferris
3a14004c7f Fix race condition updating local map data.
If the underlying local map changes, it's possible for multiple
threads to try and modify the map data associated with the UnwindLocalMap
object. Add a lock when generating the local map to avoid this problem.

In addition, add a read lock whenever any caller gets the maps iterator.
Updated all iterator callers to make this lock.

Bug: 29387050
Change-Id: Ie34822c3d8fd3bdb3dd126aeeb399969c36508c1
2016-06-16 23:28:11 -07:00
Lajos Molnar
a571d887a2 Merge \"add android_flex_layout for describing all flexible formats.\" into nyc-mr1-dev
am: c873d44942

Change-Id: I57c6c6e708935841b9195f2be3ea7becef3a8dbd
2016-06-14 20:04:09 +00:00
Dan Stoza
c873d44942 Merge "add android_flex_layout for describing all flexible formats." into nyc-mr1-dev 2016-06-14 19:59:38 +00:00
Pablo Ceballos
9cf6a9ef13 Merge \"Header changes for getFrameTimestamps\" into nyc-mr1-dev
am: 0398ec6326

Change-Id: I8d1ba8321d60407ed4eca6a50554707ceaefd3ce
2016-06-09 21:15:42 +00:00
Pablo Ceballos
c2efc32a0f Header changes for getFrameTimestamps
Change-Id: Iee9e0485544fac435e800ea869a8e4c2ed90bba9
2016-06-04 03:36:40 +00:00
Josh Gao
771c1ed582 Merge "cutils: don\'t fortify property_get on clang." am: 310da0b990
am: 2a1f209245

* commit '2a1f20924516b41e22adb766b6751869fb5c3af4':
  cutils: don't fortify property_get on clang.

Change-Id: Idd7402dca16633fa19e2110b6d74b005b3e519f9
2016-06-03 19:46:05 +00:00
Treehugger Robot
310da0b990 Merge "cutils: don't fortify property_get on clang." 2016-06-03 19:29:12 +00:00
Lajos Molnar
276f382722 add android_flex_layout for describing all flexible formats.
Bug: 22767098
Bug: 24759202
Change-Id: I61e4ca9bd71e8da88a9571ec4effc7165026715b
2016-06-03 00:59:30 +00:00
Josh Gao
74ebdf3c8e cutils: don't fortify property_get on clang.
clang doesn't do the frontend inlining/dead code elimination needed for
the fortified implementation to work. Therefore, turn it off.

Bug: http://b/28381737
Change-Id: Ie8dd970e3908b1daaa587ad2bd041e8f6e2089db
2016-06-02 15:29:11 -07:00
Calin Juravle
65d7c4722c Merge "Add utility to prepare files in a similar way to directories" into nyc-dev
am: 6a29fe931d

* commit '6a29fe931d9fd3bf7f2aad3713dc70c080970763':
  Add utility to prepare files in a similar way to directories

Change-Id: I288024d55e8cead1c902950938b03bfa8dcc3df3
2016-06-02 10:24:54 +00:00
Calin Juravle
9812105b20 Add utility to prepare files in a similar way to directories
Bug: 28785119
Bug: 28625993
Change-Id: I505eb4deca0a89f64fe4505dd6729fe6a48bc1aa
2016-05-24 18:19:12 +01:00
Hans Boehm
12f788e763 Merge "Fix SharedBuffer. Remove aref." am: 069517574e
am: 1e081a8c5f

* commit '1e081a8c5f2d6e6cb55658bb289db1f0b4f5774a':
  Fix SharedBuffer. Remove aref.

Change-Id: I5849137bb49d727d1c1d245f0f61d11c4ee10859
2016-05-23 22:22:18 +00:00
Hans Boehm
54828dc739 Fix SharedBuffer. Remove aref.
Add comment that SharedBuffer is deprecated.

Both aref and SharedBuffer had memory ordering bugs.  Aref has no
clients.

SharedBuffer had several bugs, which are fixed here:

mRefs was declared neither volatile, not atomic, allowing the
compiler to, for example, reuse a stale previously loaded value.

It used the default android_atomic release memory ordering, which
is insufficient for reference count decrements.

It used an ordinary memory read in onlyOwner() to check whether
an object is safe to deallocate, without any attempt to ensure
memory ordering.

Comments claimed that SharedBuffer was exactly 16 bytes, but
this was neither checked, nor correct on 64-bit platforms.

This turns mRef into a std::atomic and removes the android_atomic
dependency.

Bug: 28826227
Change-Id: I39fa0b4f70ac0471b14ad274806fc4e0c0802e78
(cherry picked from commit 3e4c076ef2)
2016-05-23 15:19:53 -07:00
Hans Boehm
3e4c076ef2 Fix SharedBuffer. Remove aref.
Add comment that SharedBuffer is deprecated.

Both aref and SharedBuffer had memory ordering bugs.  Aref has no
clients.

SharedBuffer had several bugs, which are fixed here:

mRefs was declared neither volatile, not atomic, allowing the
compiler to, for example, reuse a stale previously loaded value.

It used the default android_atomic release memory ordering, which
is insufficient for reference count decrements.

It used an ordinary memory read in onlyOwner() to check whether
an object is safe to deallocate, without any attempt to ensure
memory ordering.

Comments claimed that SharedBuffer was exactly 16 bytes, but
this was neither checked, nor correct on 64-bit platforms.

This turns mRef into a std::atomic and removes the android_atomic
dependency.

Bug: 28826227
Change-Id: I39fa0b4f70ac0471b14ad274806fc4e0c0802e78
2016-05-23 17:28:52 +00:00
Hans Boehm
70a46d674a Fix memory order and race bugs in Refbase.h & RefBase.cpp
Convert to use std::atomic directly.

Consistently use relaxed ordering for increments, release ordering
for decrements, and an added acquire fence when the count goes to
zero.

Fix what looks like another race in attemptIncStrong:
It seems entirely possible that the final adjustment for
INITIAL_STRONG_VALUE would see e.g. INITIAL_STRONG_VALUE + 1,
since we could be running in the middle of another initial
increment.

Attempt to somewhat document what this actually does, and
what's expected from the client. Hide the documentation in
the .cpp file for now.

Remove a confusing redundant test in decWeak. OBJECT_LIFETIME_STRONG
and OBJECT_LIFETIME_WEAK are the only options, in spite of some
of the original comments.

It's conceivable that either of these issues has resulted in
actual crashes, though I would guess the probability is small.
It's hard enough to reason about this code without the bugs.

Bug: 28705989
Change-Id: I4107a56c3fc0fdb7ee17fc8a8f0dd7fb128af9d8
(cherry picked from commit e263e6c633)
2016-05-19 16:18:26 -07:00
Hans Boehm
fdad5af164 Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp" am: 62212954ef
am: d657e639cf

* commit 'd657e639cf74e0ee5a32d0f67efe0097c3df17a1':
  Fix memory order and race bugs in Refbase.h & RefBase.cpp

Change-Id: I79106bb0399e7699d51d526235843504ab52708b
2016-05-19 22:12:01 +00:00
Hans Boehm
62212954ef Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp" 2016-05-19 22:01:41 +00:00
Elliott Hughes
847d963598 Remove a dead header (<netutils/dhcp.h>).
9c07eb9dd8 removed the implementation, but
missed the header file.

Bug: http://b/27192644
Change-Id: I809a3eb0081b05783b70dbca0274cdde6b1b31a6
2016-05-18 14:22:15 -07:00
Hans Boehm
e263e6c633 Fix memory order and race bugs in Refbase.h & RefBase.cpp
Convert to use std::atomic directly.

Consistently use relaxed ordering for increments, release ordering
for decrements, and an added acquire fence when the count goes to
zero.

Fix what looks like another race in attemptIncStrong:
It seems entirely possible that the final adjustment for
INITIAL_STRONG_VALUE would see e.g. INITIAL_STRONG_VALUE + 1,
since we could be running in the middle of another initial
increment.

Attempt to somewhat document what this actually does, and
what's expected from the client. Hide the documentation in
the .cpp file for now.

Remove a confusing redundant test in decWeak. OBJECT_LIFETIME_STRONG
and OBJECT_LIFETIME_WEAK are the only options, in spite of some
of the original comments.

It's conceivable that either of these issues has resulted in
actual crashes, though I would guess the probability is small.
It's hard enough to reason about this code without the bugs.

Bug: 28705989
Change-Id: I4107a56c3fc0fdb7ee17fc8a8f0dd7fb128af9d8
2016-05-17 16:11:11 -07:00
Elliott Hughes
cb4abee6ca Merge "Don\'t expose ashmem constants on the host." am: 54fed512b9
am: ed95190b69

* commit 'ed95190b690adf3a452001fc527881af913c5ccd':
  Don't expose ashmem constants on the host.

Change-Id: I930dd0b72e88647b1e94694e5fb183431c7d75c6
2016-05-16 17:34:13 +00:00