Commit graph

616 commits

Author SHA1 Message Date
Dimitry Ivanov
6dd58c00ca Remove liblog from libcutils as a whole static lib
libcutils no longer needs to export liblog symbols.

Bug: http://b/31289077
Bug: http://b/27171986
Test: make
Change-Id: I546a5bce56c0c88ac2493c320298d4dc13954566
2016-10-03 03:07:13 -07:00
Connor O'Brien
a2d4a6b598 Merge "Add basic tests for ashmem" 2016-09-29 21:32:02 +00: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
Treehugger Robot
6fc7eaaad0 Merge "Give wifi_hal_legacy access to netlink" 2016-09-23 16:27:41 +00:00
Treehugger Robot
53171e5f97 Merge "We should break from loop after getting connected." 2016-09-22 06:41:49 +00:00
Tao Wu
9b7341fe57 We should break from loop after getting connected.
Now it always connects to multiple address of same host and just
return one socket while other sockets get leaked.

Also, it cause trouble on machine with dual stack.
adb connect localhost:* just connect to IPv4 and IPv6 at same time
and finally it doesn't work since emulator can only handle one adb
connection.

To test this, start an emulator with non-standar port and killall adb
daemon on linux work station and then do following test.

Test: adb connect localhost:12345;lsof -n -p `pgrep adb`
Change-Id: I1e0f6824efc1db8e179377de068e3b5535aff3f7
2016-09-21 19:45:54 -07: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
Connor O'Brien
a963ae87b9 Add basic tests for ashmem
Test: CL only adds tests. Ran them to confirm they pass.
Change-Id: Iccc3edaeeabff27f23b3786c3d40b2eb5b02dc83
Signed-off-by: Connor O'Brien <connoro@google.com>
2016-09-20 16:17:24 -07:00
Mitchell Wills
d44d3b526a Give wifi_hal_legacy access to netlink
Bug: 31352200
Change-Id: I02bbbbc2be028b482d5c3d3e903ed2c9addebd77
2016-09-13 15:46:35 -07:00
Christopher Wiley
6f8e12e6fc Tag hostapd binary with CAP_NET_ADMIN | CAP_NET_RAW
Bug: 30041118
Change-Id: I14d1fd601fc4bce12c563a2004e91bd8ba0f42c3
Test: hostapd can start as the wifi user with these capabilities.
(cherry picked from commit 2502490178)
(cherry picked from commit a76088362e)
2016-09-07 13:30:23 -07:00
Josh Gao
78cc20f007 libcutils: try all addresses in socket_network_client_timeout.
If a connection fails to an address that resolves to multiple
sockaddrs, attempt connecting to subsequent addresses if the initial
connection fails to a reason other than timeout. This is primarily
useful for localhost, which can resolve to both an IPv4 and and IPv6
address.

Also, add an adb test to verify that this behavior.

Bug: http://b/30313466
Change-Id: Ib2df706a66cf6ef8c1097fdfd7aedb69b8df2d6e
Test: python test_adb.py (+ the test fails before this patch)
2016-09-01 15:56:58 -07:00
John Reck
2e336b1da1 Fix access check
Fixes a bug where USE_CPUSET used access(F_OK)
as a sign that it should try writing to the cpuset
path. It needs to instead use access(W_OK) to
ensure that it has write access as that's what
it would try to open() with.

And stop trying to repeatedly open a file that
doesn't exist.

Change-Id: Ib391ee6f08345051c48a986a732eda30143cb614
2016-08-26 14:05:03 -07:00
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
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
Greg Hackmann
9d963a2b20 Merge "libcutils: add sched_policy test"
am: 5f851752d3

Change-Id: If3f9f573303b0485582d7090afb6ecbbdca73a4f
2016-08-04 16:32:00 +00:00
Treehugger Robot
5f851752d3 Merge "libcutils: add sched_policy test" 2016-08-04 16:24:30 +00:00
Elliott Hughes
fb7e8a0088 Merge "Remove the prctl PR_SET_TIMERSLACK_PID call."
am: b3654fa086

Change-Id: I5f833a1497fcbb8b7c3f1efcd707b6186a6409e6
2016-08-04 02:31:12 +00:00
Greg Hackmann
ed0614c80b libcutils: add sched_policy test
Bug: 30597190

Change-Id: I51950e82235fa19bc92b3f7e8d190766d71af7df
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-08-03 23:31:50 +00:00
Elliott Hughes
d7967c1347 Remove the prctl PR_SET_TIMERSLACK_PID call.
This is broken on all devices other than N9, and has no real path to fixing
it because there are so many different values already in use (41, 43, 47,
127), with no way to tell which you should use on any given device.

Bug: http://b/30597190
Change-Id: I07eeaaf6f5dc03c5532ffbfbb85ef2ad750206a0
2016-08-03 15:11:01 -07:00
John Stultz
acf5e849b4 Merge \"sched_policy: Add support for /proc/<tid>/timerslack_ns over PR_SET_TIMERSLACK_PID\"
am: 817d53493a

Change-Id: Iea895b632b3bfa7daae0be34c2cc69563a18a6d5
2016-07-30 05:20:34 +00:00
John Stultz
2f13f0a48a sched_policy: Add support for /proc/<tid>/timerslack_ns over PR_SET_TIMERSLACK_PID
The PR_SET_TIMERSLACK_PID number has collided with upstream
changes a number of times, and thus the number is not consistent
between AOSP common kernel versions.

In 4.6+, the upstream kernel added equivalent functionaity via
the /proc/<tid>/timerslack_ns entry.

This patch changes the sched_policy logic to support
/proc/<tid>/timerslack_ns if its available, falling back to the
older PR_SET_TIMERSLACK_PID method if not.

NOTE: Eventually PR_SET_TIMERSLACK_PID usage will need to be
removed as it is likely to conflict with valid future upstream
PR_* entries.

Also add missing O_CLOEXEC to other open calls in this file.

Change-Id: Iec0b8a62de0dc8bdd57b60df82bd4d31c5d64709
Signed-off-by: John Stultz <john.stultz@linaro.org>
2016-07-29 14:30:20 -07:00
Elliott Hughes
1cbd1f5016 Merge \"Fix early init logging.\"
am: 6d232ab4de

Change-Id: I437dd3b5243ca7854439c438093e94733579279e
2016-07-27 15:30:45 +00:00
Elliott Hughes
35f5d04620 Fix early init logging.
Remove the /dev/__kmsg__ workarounds (which can then be removed
from sepolicy), and fix confusion in the translation between
android-base logging and kernel logging priorities (in particular,
where 'notice' comes in the hierarchy).

Bug: http://b/30317429
Change-Id: I6eaf9919904b6b55bc402c20bf1a4ae269014bc7
Test: adb shell dmesg | grep init
2016-07-26 09:32:33 -07:00
Christopher Ferris
93e00be7cc Merge \"Add ioprio values directly.\"
am: feabb0fdc1

Change-Id: Ic8f7f714c30ef70172ebce8b6de7af8d09572eba
2016-07-20 18:10:55 +00:00
Christopher Ferris
feabb0fdc1 Merge "Add ioprio values directly." 2016-07-20 18:03:48 +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
Christopher Ferris
84421d8475 Add ioprio values directly.
The ioprio.h header is not a uapi header, so remove it's use and
add the two values that this code needs to use.

Bug: 30072483
Change-Id: I5c8b6f40bd60a43f50ac26792f96d2fa3f6db020
2016-07-18 17:01:05 -07:00
Dan Willemsen
4e8bb3e677 Merge \"libcutils: Switch to Android.bp\"
am: bc6c52f905

Change-Id: Ie2beefe7f9992740ada57d6ab989abb74d257c5b
2016-07-13 00:41:15 +00:00
Dan Willemsen
eee8e7face libcutils: Switch to Android.bp
Change-Id: If36cb30e8e4432f1a5c7f9a6d30a75c012a4c67c
2016-07-12 16:37:08 -07: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
Mark Salyzyn
ec129fe06c Merge \"libcutils: canned_fs_config.c drop tabs\"
am: 4ee9ed5366

Change-Id: Ie72d7562be3316d2ebe732dd1d1fbd4a04b6557b
2016-07-06 18:54:23 +00:00
Mark Salyzyn
768cbb0404 libcutils: canned_fs_config.c drop tabs
- replace tabs with spaces, get indent right
- Sort header order as per Android coding standard

Change-Id: I634f6f716a368ce5565ccc880c51406042f312bf
2016-07-06 10:45:11 -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
Elliott Hughes
7191a56e96 Merge \"Remove unnecessary ARRAY_SIZE macros.\"
am: c37d8ea22a

Change-Id: Id3443d7247e893ee549ae5b799a8f0bf42088d35
2016-06-29 00:16:44 +00:00
Elliott Hughes
749ae2d32f Remove unnecessary ARRAY_SIZE macros.
Use the canonical one instead.

Change-Id: Id80f19455f37fd2a29d9ec4191c1a0af80c5c0e7
2016-06-28 14:48:45 -07:00
Josh Gao
88347e1430 Merge changes from topic \'debuggerd_client\'
am: abf88685e3

Change-Id: I2a61e4e8b5ec5a4ab6566ab4f8eb31653255fbc5
2016-06-20 20:47:18 +00:00
Josh Gao
9c02dc5916 debuggerd: add libdebuggerd_client.
Bug: http://b/24414818
Change-Id: I079c534d2c952b6975bf0428eb86cc7a55525737
2016-06-17 13:11:29 -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
6a29fe931d Merge "Add utility to prepare files in a similar way to directories" into nyc-dev 2016-06-02 10:10:37 +00:00
Erik Kline
deb4e6e596 Merge "Add /vendor/xbin to the list of directories of executables" into nyc-dev
am: 088f0e7c40

* commit '088f0e7c40a1cc66505f2bd73c54f3bab9908986':
  Add /vendor/xbin to the list of directories of executables

Change-Id: Ib1172d5a5f0f0f1a82ce5ca260ef4539761ef679
2016-05-30 02:36:42 +00:00
Chih-Hung Hsieh
5fb629a212 resolve merge conflicts of e845c04 to nyc-dev-plus-aosp
Change-Id: I423f722dcc3821b9be52613d68640b49cbac70a6
2016-05-27 16:04:21 -07:00
Erik Kline
a5a9c74f20 Add /vendor/xbin to the list of directories of executables
Bug: 28850734
Change-Id: Iaa14a463294d1f8a9c69328a273ce7f12a558bab
2016-05-27 17:37:53 +09: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
Chih-Hung Hsieh
c713bce901 Fix misc-macro-parentheses warnings in init and other core modules.
Bug: 28705665
Change-Id: Ice67cebb8c42538f8fb9cf1756678f41a9d68a31
2016-05-18 18:11:49 -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
Elliott Hughes
427c605b2a Don't expose ashmem constants on the host.
Change-Id: I86bf58841645114e382300228be7be69a555e76b
2016-05-13 14:47:30 -07:00