Commit Graph

24180 Commits

Author SHA1 Message Date
Elliott Hughes 16533c7c0b Merge "Use readdir instead of readdir_r."
am: 833df5cd54

Change-Id: Ie7de2a969ff5424bd28e3a5ce783266c2ec63bd0
2016-09-29 16:43:48 +00:00
Elliott Hughes 833df5cd54 Merge "Use readdir instead of readdir_r." 2016-09-29 16:38:45 +00:00
Elliott Hughes 9f206938ed Use readdir instead of readdir_r.
http://elliotth.blogspot.com/2012/10/how-not-to-use-readdirr3.html

Test: boots.
Change-Id: If75532e24fe4d17743bf8e8c9590156dee378a63
2016-09-28 14:04:12 -07:00
Mark Salyzyn 930ff186ce Merge "liblog: fix errno issues with event tag map"
am: dfd30c4a16

Change-Id: Ic8db0058a3258d356f3732727a4628c013f76b4c
2016-09-28 18:14:48 +00:00
Treehugger Robot dfd30c4a16 Merge "liblog: fix errno issues with event tag map" 2016-09-28 18:07:09 +00:00
David Pursell 94c652ed31 Merge "adb: fix host-side serial number parsing for IPv6."
am: b1c4d90215

Change-Id: I62454f520192df9b600280b59704e7c0fe55687f
2016-09-28 17:35:47 +00:00
Treehugger Robot b1c4d90215 Merge "adb: fix host-side serial number parsing for IPv6." 2016-09-28 17:30:29 +00:00
Mark Salyzyn 7d1c2ab2bc Merge "liblog: free event tag map in __android_log_close()"
am: 1dfa8112ce

Change-Id: I2b613be1642570b678dbb9d199b7287d6f9f6cc7
2016-09-28 15:02:36 +00:00
Treehugger Robot 1dfa8112ce Merge "liblog: free event tag map in __android_log_close()" 2016-09-28 14:58:39 +00:00
Dan Albert fda0868744 Merge "Migrate liblog to ndk_library."
am: b98317ff1c

Change-Id: I660f4470e730d43d0a9896d3665cd40134c636d0
2016-09-27 20:43:36 +00:00
Josh Gao 279a1ea5b0 Merge "adb: fix IOKit handle leaks on OS X."
am: a2aff3f809

Change-Id: I24587b122c3d4d57eef137456c3628e4010d7b5c
2016-09-27 20:43:24 +00:00
Treehugger Robot b98317ff1c Merge "Migrate liblog to ndk_library." 2016-09-27 20:38:45 +00:00
Josh Gao a2aff3f809 Merge "adb: fix IOKit handle leaks on OS X." 2016-09-27 20:38:37 +00:00
Josh Gao b6a2f59515 adb: fix IOKit handle leaks on OS X.
Bug: https://code.google.com/p/android/issues/detail?id=219085
Test: Removed sleep in RunLoopThread, compared before/after this patch
Change-Id: Ia65bbedfb7d47bdb02bdfb69778784e5e855900b
2016-09-27 12:36:58 -07:00
Iliyan Malchev fe0d0be9a9 Merge changes from topic 'b/31458381'
am: 8d8545120c

Change-Id: If4de2dff5c3b4a253529f52a2c2af118147b1961
2016-09-27 00:10:32 +00:00
Iliyan Malchev ad0cbcf21c init.rc: have hwservicemanager start the HAL class
am: 57d66b8447

Change-Id: I8ee19e5f08c514bad1315d24546725203b41c13c
2016-09-27 00:08:22 +00:00
Martijn Coenen a2249bc1bd Add hwbinder dev node permissions.
am: f5110ea029

Change-Id: I67ee1a3ca8a1e226f7487b33fda21943ca77b696
2016-09-27 00:08:19 +00:00
Treehugger Robot 8d8545120c Merge changes from topic 'b/31458381'
* changes:
  init.rc: have hwservicemanager start the HAL class
  Add hwbinder dev node permissions.
2016-09-26 23:54:54 +00:00
Elliott Hughes 5dc7e6a79a Merge "Switch adb to <android-base/properties.h>."
am: d9a23b5733

Change-Id: I09a1832143d9f54cd67128602c9e518a1b398b5c
2016-09-26 22:19:04 +00:00
Treehugger Robot d9a23b5733 Merge "Switch adb to <android-base/properties.h>." 2016-09-26 21:58:16 +00:00
Mitchell Wills d62dcfa03f Merge "Add fastboot --skip-reboot flag"
am: 60a99eb8f7

Change-Id: Id3ee7f6603437fae7ed26e8af93235f6531e0219
2016-09-26 21:13:23 +00:00
Treehugger Robot 60a99eb8f7 Merge "Add fastboot --skip-reboot flag" 2016-09-26 21:08:07 +00:00
Elliott Hughes ffdec18017 Switch adb to <android-base/properties.h>.
Bug: http://b/23102347
Test: manual
Change-Id: Iffa66258c01f84f41b9af99ab5e768a0a2669106
2016-09-26 13:14:14 -07:00
Mitchell Wills 31dce302db Add fastboot --skip-reboot flag
Add a flag to fastboot that will cause it to not reboot the device after
performing commands like update and flashall.

Fixed: 31743001
Test: run fastboot update with and without --skip-reboot flag
Change-Id: I7f4056249a52779c7fc752c9d1009a58a44762df
2016-09-26 11:27:16 -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
Mark Salyzyn ba1a798fd8 liblog: free event tag map in __android_log_close()
There is no leak since a reference always remained and could get
reused.  It just makes sense to also close the event tag map as well
if logging is closed.  If we close we also have to fix a tagArray
leak in android_closeEventTagMap().

NB: __android_log_close() already makes an assumption that another
thread is not logging at the same time, which is true in all callers
at this time.  There are some partial mitigation strategies if
__android_log_close() is called asynchronously, but not completely
solved at the cost of a lock for every logging call.

Test: gTest liblog-unit-tests
Bug: 30963384
Bug: 31456426
Change-Id: Ib76ad9302dba4d3f35250213f4dfef22498af238
2016-09-26 08:21:13 -07:00
Iliyan Malchev 57d66b8447 init.rc: have hwservicemanager start the HAL class
b/31458381
Test: passing build and runtime tests

Change-Id: I1d26af5ca1d0e9c7bbd97cfd88d0b432b50b7216
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-26 00:23:51 -07:00
Martijn Coenen f5110ea029 Add hwbinder dev node permissions.
b/31458381
Test: pass

Change-Id: I8ec92a29287b17636c363c55a8565dacab19043d
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-09-26 00:23:51 -07:00
Andreas Gampe 8ca0a71c51 Merge "Base: Remove LOG_S variants."
am: aa00f5852f

Change-Id: Iac81601db10497ac7416752c25cc4cddb3434756
2016-09-26 00:42:28 +00:00
Treehugger Robot aa00f5852f Merge "Base: Remove LOG_S variants." 2016-09-26 00:37:13 +00:00
Andreas Gampe 1f5fb43047 Base: Remove LOG_S variants.
Partially reverts commit 436f5a031f.

Remove the variants taking a fully qualified LogSeverity. Instead
use a lambda with "using" statements to translate both qualified
and unqualified names into valid expressions.

Compile-time regression was measured as 0.1s for a thousand LOG
statements on a z840.

Update tests.

Bug: 31338270
Test: m
Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64
Change-Id: I36fdf30a9d535b19543307b85d1b3c19a97f20dd
2016-09-24 10:18:38 -07:00
Elliott Hughes 621127a2cb Merge "Add std::string system property functions."
am: 3f049c3f19

Change-Id: Ib8c802c8c4e00e7b601c5eb1e6d64693954f5b94
2016-09-24 04:59:55 +00:00
Treehugger Robot 3f049c3f19 Merge "Add std::string system property functions." 2016-09-24 04:52:59 +00:00
Andreas Gampe 1f03df8155 Merge "Base: Check severity in destructor"
am: 19a7696488

Change-Id: I07f89e907304d754523f9026f857b5c94601b6e3
2016-09-23 23:15:49 +00:00
Treehugger Robot 19a7696488 Merge "Base: Check severity in destructor" 2016-09-23 23:12:09 +00:00
David Pursell bb276d8555 Merge "Flattenable: switch from assignment to memcpy()."
am: b2356a6993

Change-Id: I3d4cb834d67693c65e71af6a7c360eb82b31b055
2016-09-23 22:51:49 +00:00
David Pursell b2356a6993 Merge "Flattenable: switch from assignment to memcpy()." 2016-09-23 22:46:03 +00:00
Dan Albert ddce8c70c4 Migrate liblog to ndk_library.
Test: make native
Bug: http://b/30465923
Change-Id: I3db7ede817a57b3505c0556ea28f08b9e8331e1a
2016-09-23 15:43:23 -07:00
Elliott Hughes 1e88c8c0ac Add std::string system property functions.
Makes it easier to write correct code in a world where the maximum
property key/value lengths change.

Bug: http://b/23102347
Test: libbase_test64
Change-Id: I100f00904221bbcef9e8786a4e6e30428039bb49
2016-09-23 15:30:22 -07: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 4873829953 Merge "Move android_get_control_socket out of line"
am: 4b5abcdba2

Change-Id: If427dfca41a23d94f2f026edbeb0dc8cd73a4724
2016-09-23 20:56:39 +00:00
Treehugger Robot 4b5abcdba2 Merge "Move android_get_control_socket out of line" 2016-09-23 20:49:19 +00:00
Andreas Gampe 19ff8f1e57 Base: Check severity in destructor
Bug: 31338270
Test: m
Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64
Change-Id: Ic077822bcfd591bd11f4fa9d4b6e440b461c70c1
2016-09-23 13:31:52 -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
Mitchell Wills c3d7cb95cc Merge "Give wifi_hal_legacy access to netlink"
am: 6fc7eaaad0

Change-Id: Ia3a6d48dab8123a5dc4e42d4b0d271d2e2c880e2
2016-09-23 16:32:57 +00:00
Treehugger Robot 6fc7eaaad0 Merge "Give wifi_hal_legacy access to netlink" 2016-09-23 16:27:41 +00:00
Andreas Gampe 9148006e85 Merge "Base: Add more log macros"
am: 58af713d8a

Change-Id: Ia8a446e8e2609f2d7e31bcfb1eec83fc82bbeebb
2016-09-22 23:59:10 +00:00
Treehugger Robot 58af713d8a Merge "Base: Add more log macros" 2016-09-22 23:56:48 +00:00
Colin Cross 0f79b62bf6 Merge "Fix warnings in libutils headers"
am: 65a1633ec3

Change-Id: I65b7448a5aeaa868e40dfdda2b7cd8a6eb54a9e2
2016-09-22 21:55:34 +00:00
Treehugger Robot 65a1633ec3 Merge "Fix warnings in libutils headers" 2016-09-22 21:24:49 +00:00