Commit graph

762 commits

Author SHA1 Message Date
Treehugger Robot
1e48879b6c Merge "Bluetooth hal: moved to vendor partition." 2017-02-28 04:00:58 +00:00
Steven Moreland
18676b2ca8 Bluetooth hal: moved to vendor partition.
Bug: 35328775
Test: works in both binderized and passthrough modes
Merged-In: I61f1ff6b777089d7aad5184c0aee4f653897b32e
Change-Id: I61f1ff6b777089d7aad5184c0aee4f653897b32e
2017-02-28 01:34:59 +00:00
Treehugger Robot
dfbae6ddbb Merge changes Iede18a00,Ib0fa24fb,Ic4c8a137
* changes:
  libcutils: build tests with -Wall -Wextra -Werror
  libcutils: fix socket type in SocketsTest.TestGetLocalPort
  libcutils: fix Wsign-compare warnings in multiuser_test
2017-02-28 00:11:07 +00:00
Alex Klyubin
3380927e71 Make secilc accessible by root only
There's no reason for SELinux policy compiler to be accessible by
anybode other than root.

Test: Device boots -- secilc isn't used yet anyway
Bug: 31363362
Change-Id: I26cf34f1412b8dd471f79271c491b473617a6df6
2017-02-27 13:27:58 -08:00
Greg Hackmann
a930af8921 libcutils: build tests with -Wall -Wextra -Werror
Test: mmm system/core/libcutils/tests

Change-Id: Iede18a008df5834b8ecedd6019c4444150748f68
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-02-22 10:58:38 -08:00
Greg Hackmann
7c60ec3029 libcutils: fix socket type in SocketsTest.TestGetLocalPort
With -Wall enabled locally, clang points out that the second parameter
to socket_inaddr_any_server() was accidentally hard-coded:

system/core/libcutils/tests/sockets_test.cpp:103:18: warning: unused variable 'type' [-Wunused-variable]
        for (int type : {SOCK_DGRAM, SOCK_STREAM}) {
                 ^

Bug: 26936282
Test: mmm system/core/libcutils/tests
Test: adb shell /data/nativetest/libcutils_test/libcutils_test32 \
	--gtest_filter=SocketsTest.TestGetLocalPort (on hikey)
Test: adb shell /data/nativetest64/libcutils_test/libcutils_test64 \
        --gtest_filter=SocketsTest.TestGetLocalPort (on hikey)

Change-Id: Ib0fa24fb02a5ee14db0afd6591a62089e43bbec0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-02-22 10:58:38 -08:00
Greg Hackmann
6d90fdc5e5 libcutils: fix Wsign-compare warnings in multiuser_test
gid_t and uid_t are unsigned ints, so we need to compare against unsigned
constants.

Bug: 26936282
Test: mmm system/core/libcutils/tests
Test: adb shell /data/nativetest/libcutils_test/libcutils_test32 \
	--gtest_filter=MultiuserTest.* (on hikey)
Test: adb shell /data/nativetest64/libcutils_test/libcutils_test64 \
	--gtest_filter=MultiuserTest.* (on hikey)

Change-Id: Ic4c8a137e3f37cb5e95ba925814f201cfd5a06b0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-02-22 10:58:34 -08:00
Isaac Chen
795267d4c7 Removed cpusets/schedboost build time dependency.
These two Soong product_variables were usually controlled by
ENABLE_CPUSETS and ENABLE_SCHEDBOOST in BoardConfig.mk. This change
turns the build time variables into runtime decision by checking if
a special file, "tasks", can be found under the mount points,
/dev/cpuset and /dev/stune, for cpusets and schedboost, respectively.

That special file only exists when the corresponding Linux kernel
configurations, CONFIG_CPUSETS and CONFIG_SCHEDTUNE, are set.

Bug: 34726944

Test: Tested on Sailfish with following configurations
          neither cpuset nor schedtune enabled in the kernel
          cpuset enabled, but schedtune disabled in the kernel
          both cpuset and schedtune enabled in the kernel

Change-Id: I6695b8b32b2fecb4fd995018418bbe2edc5d590f
2017-02-20 20:53:24 +08:00
Treehugger Robot
01003d40fc Merge "Implement android::base::WaitForProperty." 2017-02-14 03:48:26 +00:00
Steven Moreland
b7ca92349e fs_config: wifi is now on vendor partition
Bug: 34135607
Test: pass
Change-Id: I0c9dd9642e780a0303e6aaa6d80e443c59cc0c28
2017-02-13 17:21:17 -08:00
Elliott Hughes
b30769a87a Implement android::base::WaitForProperty.
Also adapt libcutils to the bionic change that was necessary for this.

Bug: http://b/35201172
Test: ran tests
Change-Id: I72a98b70b03d23e958b46778b505fbd5c86c32ae
2017-02-13 11:29:02 -08:00
George Burgess IV
67959bceb2
cutils: Add clang FORTIFY support
Bug: 32073964
Test: Builds on angler, bullhead, marlin, sailfish. Bionic CTS tests
pass on Angler and Bullhead.

Change-Id: I3d7f8ff73f92b1deb1e07f08282098e71e2d03a9
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-02-09 20:18:19 +01:00
Josh Gao
ac91b0c452 Revert "Give crash_dump CAP_SYS_PTRACE."
This reverts commit 36397cb168.

Bug: http://b/34853272
Test: debuggerd -b `pidof system_server`
Test: debuggerd -b `pidof zygote`
Change-Id: Ibccbccd956779f268d498a52aa737c1959538831
2017-02-01 17:55:22 -08:00
Evgenii Stepanov
54c7886c40 Disable integer sanitization on host.
Test: NFC until https://android-review.googlesource.com/#/c/329510
Change-Id: I4d1bb66821b2984bbee12438cfd72b9b63d56605
2017-01-31 16:33:53 -08:00
Treehugger Robot
c8121ba029 Merge "Support arbitrary-length properties in property_list." 2017-01-27 03:18:04 +00:00
Elliott Hughes
4eacd70f85 Support arbitrary-length properties in property_list.
Bug: http://b/33926793
Test: visual inspection
Change-Id: Ida84c3aaafa5411a9886f8d3d45679fd60ddc00d
2017-01-26 17:33:12 -08:00
George Burgess IV
09175a0264 Add mode bits to a call to open with O_CREAT
Open with O_CREAT needs mode bits: https://linux.die.net/man/3/open

Found by running clang FORTIFY over AOSP.

Bug: 32073964
Test: Now builds with clang FORTIFY.
Change-Id: Iee4c93c5482f510e0adf8104c27e394b5d87ec88
2017-01-25 17:31:43 -08:00
Vijay Venkatraman
01678a0c84 Merge "Revert "Revert "Exporting C headers from system/core""" 2017-01-25 23:37:01 +00:00
Vijay Venkatraman
651f8383e6 Revert "Revert "Exporting C headers from system/core""
This reverts commit a3f2be2b73.

Test: compile
Change-Id: I04b3a8e47e1fa3eb9d80c14ae3a90c68a780e858
2017-01-25 12:50:29 -08:00
Josh Gao
36397cb168 Give crash_dump CAP_SYS_PTRACE.
CAP_SYS_PTRACE is needed to ptrace processes that have capabilities
greater than their bounding set. Eventually, this will still be an
improvement, because we can ptrace attach, and then turn on a seccomp
filter that blocks further attaches.

Bug: http://b/34694637
Test: debuggerd `pidof system_server`
Change-Id: I4b9da164ec1fbb5060fdba590e886ac24b6a0785
2017-01-25 11:48:23 -08:00
Elliott Hughes
acdb06de6b Merge "Remove unused klog_get_level." 2017-01-25 16:39:11 +00:00
Vijay Venkatraman
a3f2be2b73 Revert "Exporting C headers from system/core"
This reverts commit 3c6763ca21.

Change-Id: If3b3e106478d28a5df927d57649abdca0a99dd0e
2017-01-25 00:44:08 +00:00
Vijay Venkatraman
3c6763ca21 Exporting C headers from system/core
Moved headers from include/libcutils and include/liblog to
libcutils/include and liblog/include respectively, so they can be
exported via these libs. They needed to be moved since Soong does
not allow export from external folder.

Added symlink from old locations. They are needed since Soong
includes system/core/include by default. Once all modules are
cleaned up to explicitly add the required libs, the symlinks will be
removed.

Also added liblog_vndk_headers that exports a special log/log.h for
VNDK.

Moved headers of libcutils to libcutils_headers. They should be used
by modules for header-only inlines. Added libcutils_headers as
dependency of libcutils.

Added libcutils_vndk_headers that exports a special cutils/log.h
deprecating usage of the file. A later CL will deprecate the one in
libcutils_headers

Test: Add above libs to shared lib of local module
Change-Id: I6e1f9c5f23d8b6eae13dc3b7e5dfe7fae93b8510
2017-01-22 19:45:38 -08:00
Treehugger Robot
8dbab358f0 Merge "Load default/build props from each partition" 2017-01-20 03:58:52 +00:00
Jeff Sharkey
7e5d0b1fae Define GID range for external data and OBBs.
To quickly answer the question of "how much data is a UID using?" we
need a GID range to label files on external storage, similar to
the GID ranges already defined for cached and shared data.

Also define a new GID that will be used to label the OBB files shared
between all users under /data/media/obb.

Test: builds, newly added tests pass
Bug: 34263266
Change-Id: I16fb7d166c3dcdeafbf477162d191d3b73ae8ac2
2017-01-18 17:11:05 -07:00
Jaekyun Seok
de21de7a42 Load default/build props from each partition
The following files will be loaded additionally.
- /odm/default.prop and /vendor/default.prop for default props.
- /odm/build.prop for build props.

The props files must follow the following priority order.
- /default.prop > /odm/default.prop > /vendor/default.prop
- /system/build.prop > /odm/build.prop > /vendor/buid.prop

Test: tested default/build prop files with enabling early mount, but
didn't test files of odm partition because odm partition doesn't
exist now.
Bug: 34116668
Change-Id: I946d076dae38f2288865dd986fb16d801d4abcc0
2017-01-19 08:45:40 +09:00
Josh Gao
cbe70cb0a8 debuggerd: advance our amazing bet.
Remove debuggerd in favor of a helper process that gets execed by
crashing processes.

Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I9906c69473989cbf7fe5ea6cccf9a9c563d75906
2017-01-17 13:57:57 -08:00
Elliott Hughes
e04c3b0533 Remove unused klog_get_level.
Every little helps...

Bug: N/A
Test: builds
Change-Id: Ibcac5cda1619420c95903211ed0b96af81351f9e
2017-01-13 18:14:12 -08:00
Wei Wang
677ba31db2 libcutils: change klog_level to KLOG_INFO_LEVEL
Some of Android componets e.g. init have migrated to use base/logging to get rid
of klog utilities. However, without explicit initilization, the default
klog_level is set to 3 which masks the logwrap output.
This patch sets default klog_level to KLOG_INFO_LEVEL to make
android_fork_execvp_ext log available.

Bug: 34256270
Test: manual
Change-Id: Ibe74707a92c954053cd0e6828a984fbd72b4acae
2017-01-12 22:18:46 -08:00
Mark Salyzyn
01e12b4ee7 Merge "liblog: use log/log.h when utilizing ALOG macros" 2017-01-11 19:07:17 +00:00
Mark Salyzyn
30f991f251 liblog: use log/log.h when utilizing ALOG macros
Test: compile
Bug: 30465923
Change-Id: Id6d76510819ebd88c3f5003d00d73a0dbe85e943
2017-01-11 09:31:15 -08:00
Andre Eisenbach
8097210093 Allow Bluetooth HAL to access /sys/class/rfkill
Test: compiles; HAL can write rfkill state
Change-Id: I5815a1f50ef8d09bf83541a6d2389b61bd007306
2017-01-10 23:40:20 +00:00
Myles Watson
e67abec514 libcutils: Use strnlen for default property values
Add unit tests to test the corner cases.

Test: unit tests pass before and after the change.
Change-Id: Idafeb8354cd6c7db2a68cd398dafe153453a3940
2016-12-22 09:21:06 -08:00
Myles Watson
22c0962ab9 Use clang-format to fix up properties.c
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 100

Test: unit tests pass
Change-Id: Ie1a9bf85c001ef1a2dcdafdc5bf696b9267116f7
2016-12-22 09:20:57 -08:00
Nick Kralevich
5f9fa90425 fs_config.c: make *.prop files 0600
Enforce that the only API for reading properties is through the property
server, not by reading the (system|vendor|rootfs) *.prop files.

Test: Device boots and no property errors.
Change-Id: Ibb6ed4e74a80cac00010c707d7574f8e92fc6448
2016-12-16 14:54:02 -08:00
Jeff Sharkey
da94f09e22 Merge "Define range of GIDs for cached app data." 2016-12-15 21:46:31 +00:00
Jeff Sharkey
dff44709cf Define range of GIDs for cached app data.
To support upcoming disk usage calculation optimizations, this change
creates a new GID for each app that will be used to mark its cached
data.  We're allocating these unique GIDs so that we can use
quotactl() to track cached data on a per-app basis.

This change also tightens up the implementation of both the cache
and shared GID calculation to ensure that they stay inside the valid
ranges, and includes tests to verify.

Test: builds, boots, tests pass
Bug: 27948817
Change-Id: Ie4377e5aae267f2da39a165888139228995987cb
2016-12-13 13:28:08 -07:00
Sandeep Patil
5fee496e62 socket: uevent: use SO_RCVBUF instead of SO_RCVBUFFORCE
The SO_RCVBUFFORCE option requires the caller of uevent_create_socket()
to have net_admin capabilities.

Set platform default rcv/snd buffer sizes to 256kb that will always be
overridden by the device/target. However, it will allow
ueventd / healthd to use the uevent_create_socket() API w/o requiring
the net_admin capability.

Note: All devices override the buffer sizes according to the technology
maximum to at least ~8MB. So, the init.rc change here is to make sure
platform code can work w/o any overrides.

Test: no SELinux failures for healthd with 'net_admin' removed.

Bug: https://b/32733887

Change-Id: Ida346468cd550ad07901bf3a78ad508939849906
Signed-off-by: Sandeep Patil <sspatil@google.com>
2016-12-09 15:16:28 -08:00
Elliott Hughes
8656ed109b Merge "Use hasmntopt(3) rather than reinventing the wheel."
am: 769a5a1962

Change-Id: I62541c0ff6961888239a7686bb37115b39fc787b
2016-11-30 22:49:53 +00:00
Elliott Hughes
769a5a1962 Merge "Use hasmntopt(3) rather than reinventing the wheel." 2016-11-30 22:32:44 +00:00
Elliott Hughes
8c1838823a Use hasmntopt(3) rather than reinventing the wheel.
Bug: N/A
Test: "power off" still works
Change-Id: I11d3dc22f98ac71608c9929a3fd43319c787d49e
2016-11-30 09:37:17 -08:00
Mark Salyzyn
6878cd20e6 Merge "libcutils: tests"
am: bac388e424

Change-Id: I86a00ea257985836400b530c1e60bdc5e070dd00
2016-11-30 17:28:39 +00:00
Mark Salyzyn
678194ddac libcutils: tests
Respect "android" and "not_windows" (linux + darwin). This
means the string test and control support routines were not
being tested on android.

Test: gTest libcutils_test
Bug: 32450474
Change-Id: I9505fefeb0a4a8c5b54aa637812b4f3c07c2893c
2016-11-29 10:08:12 -08:00
Mark Salyzyn
5a411029de Merge "libcutils: sdk(mac) build error (part deux)"
am: ed0a48c617

Change-Id: Id6d3a5568a3383111592fd097ab8c96568783522
2016-11-17 16:43:06 +00:00
Mark Salyzyn
0958b18da0 libcutils: sdk(mac) build error (part deux)
Test: Build
Bug: 32450474
Change-Id: I92cca30217715779a9db6a60e2e4831a20cec3d4
2016-11-17 08:33:26 -08:00
Mark Salyzyn
7bc8810a4a Merge "libcutils: sdk(mac) build error"
am: 231d1ac640

Change-Id: Icca67be8194faa296b93e9bfec2a15002ac06147
2016-11-17 16:19:34 +00:00
Mark Salyzyn
6b652160d1 libcutils: sdk(mac) build error
Surprise surprise, MAC sdk build has F_GETFD & not TEMP_FAILURE_RETRY.
Revert code to original form with the three alternatives for all OSii.

Test: Build
Bug: 32450474
Change-Id: Ia7361d8107675a620968d8395c5e2351ad364d29
2016-11-17 08:05:16 -08:00
Mark Salyzyn
809dee506e Merge "libcutils: move cutils/files.h to cutils/android_get_control_file.h"
am: 8c41e791ed

Change-Id: Ifbc00285da734859d590153a7c6cfc8e51c014f9
2016-11-17 15:33:02 +00:00
Mark Salyzyn
52bd37e633 libcutils: move cutils/files.h to cutils/android_get_control_file.h
files.[h|cpp] is bound to be abused with junk, replace with
android_get_control_file.[h|cpp]. Plus some sundry cleanup.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests and init_tests
Bug: 32450474
Change-Id: Ibd4a7aa4624ea19a43d1f98a3c71ac37805d36b5
2016-11-16 15:56:56 -08:00
Mark Salyzyn
d32e7f4703 Merge "libcutils: sockets_test breaks MAC build"
am: 8d339e940f

Change-Id: I4dbc000a63c45f82a32012629eec855c60c17b5a
2016-11-04 19:51:07 +00:00