Commit graph

641 commits

Author SHA1 Message Date
Treehugger Robot
c1f74ca5aa Merge changes Ibf4774f7,I6568eea0,I35e83679,I9faf8826,I8ee9d999
* changes:
  fs_mgr: use __android_log_is_debuggable()
  adb: use __android_log_is_debuggable()
  debuggerd: use __android_log_is_debuggable()
  logd: use __android_log_is_debuggable()
  libcutils: use __android_log_is_debuggable()
2016-10-18 16:33:28 +00:00
Treehugger Robot
5171bebf41 Merge "Remove socket_loopback_client." 2016-10-14 18:21:38 +00:00
Mark Salyzyn
b5aa4e7125 libcutils: use __android_log_is_debuggable()
Test: compile and boot smoke test
Bug: 27566046
Bug: 31456426
Change-Id: I8ee9d999a2e6a0336e45b6180ce6fd7975c113dc
2016-10-14 08:04:19 -07:00
Treehugger Robot
955648a915 Merge "Rely on the platform -std default." 2016-10-14 02:28:38 +00:00
Treehugger Robot
c32d7fd66f Merge "Fallback to IPv6 when IPv4 is not available in adb" 2016-10-14 01:35:43 +00:00
Elliott Hughes
dd92a0a812 Remove socket_loopback_client.
Bug: http://b/31537253
Test: builds
Change-Id: If02c8107206fb60e4622f8937bee0d0a362e1c7d
2016-10-13 16:51:46 -07:00
Chia-I Wu
d790aae4bc Merge "Add native_handle_init" 2016-10-13 22:18:11 +00:00
Tao Wu
7b700763f5 Fallback to IPv6 when IPv4 is not available in adb
Test: manual - make sure it works in both IPv4/IPv6 env.
BUG: 31537253
Change-Id: Ica492bff34a8c0441516a213d0e8b78fcdfd3282
Signed-off-by: Tao Wu <lepton@google.com>
2016-10-13 08:54:43 -07:00
Elliott Hughes
58f7f61266 Merge "Start retiring socket_loopback_client." 2016-10-13 14:38:48 +00:00
Chia-I Wu
b843791b61 Add native_handle_init
HIDL requires file descriptors to be wrapped in native_handle_t.  We want
a low overhead way to do that when the number of file descriptors is known
at compile time.  Instead of

  // wrap an fd in native_handle_t
  native_handle_t* fd_handle = native_handle_create(1, 0);
  if (!fd_handle) {
    // clean up and return error
  }
  fd_handle->data[0] = fd;

  hidl_cb(..., fd_handle);

  native_handle_delete(fd_handle);

this change adds native_handle_init to allow for

  // wrap an fd in native_handle_t
  NATIVE_HANDLE_DECLARE_STORAGE(fd_storage, 1, 0);
  native_handle_t* fd_handle = native_handle_init(fd_storage, 1, 0);
  fd_handle->data[0] = fd;

  hidl_cb(..., fd_handle);

Test: make libcutils
Bug: 32021609
Change-Id: If1fd07482243d37492fdea57c602a1b13c8953cc
2016-10-12 18:04:41 -07:00
Elliott Hughes
139b372fab Start retiring socket_loopback_client.
Bug: http://b/31537253
Test: can still talk to adb
Change-Id: Icfd7f00d35cf963befc139e81904790b4b8b67c0
2016-10-11 13:45:03 -07:00
Elliott Hughes
36e0d390a2 Rely on the platform -std default.
Bug: http://b/32019064
Test: builds
Change-Id: I18a1d816d63b64601485045070851f32d44e85eb
2016-10-10 14:31:12 -07:00
Dimitry Ivanov
afda14e61d Merge "Revert "Revert "Revert "Revert "Remove liblog from libcutils as a whole static lib""""" 2016-10-08 07:51:33 +00:00
Chia-I Wu
e8f6c7398b Merge "Add native_handle_clone" 2016-10-08 01:25:35 +00:00
Dimitry Ivanov
625484ddfa Revert "Revert "Revert "Revert "Remove liblog from libcutils as a whole static lib""""
This reverts commit 6a452917b3.

Bug: http://b/31289077
Bug: http://b/27171986
Change-Id: Id020fa10c50847bf16a2fcbc7d5e72cf8766b711
2016-10-07 18:43:37 +00:00
John Reck
b02a355d10 Merge "Revert "Revert "Revert "Remove liblog from libcutils as a whole static lib"""" 2016-10-07 16:32:38 +00:00
John Reck
6a452917b3 Revert "Revert "Revert "Remove liblog from libcutils as a whole static lib"""
This reverts commit 595c1480d0.

Revert reason: broke bullhead-eng build in master

Change-Id: Ie64fc31c3c971366ab9f2543b91b8f5d2040868b
2016-10-07 16:22:38 +00:00
Treehugger Robot
8949696d33 Merge "Revert "Revert "Remove liblog from libcutils as a whole static lib""" 2016-10-06 14:20:41 +00:00
Dimitry Ivanov
595c1480d0 Revert "Revert "Remove liblog from libcutils as a whole static lib""
This reverts commit f93d732a45.

Bug: http://b/31289077
Bug: http://b/27171986
Change-Id: Ib6e6c0a01296f0a01d98cbf1a9d2659883280d44
2016-10-06 12:47:07 +00:00
Dimitry Ivanov
d4446ccce8 Merge "Revert "Remove liblog from libcutils as a whole static lib"" 2016-10-03 22:21:19 +00:00
Dimitry Ivanov
f93d732a45 Revert "Remove liblog from libcutils as a whole static lib"
This reverts commit 6dd58c00ca.

Bug: http://b/31289077
Bug: http://b/27171986
Change-Id: I519d77de118f02346a4f89b197ca4df7e9f883ac
2016-10-03 22:18:49 +00:00
Dimitry Ivanov
dd01f980e5 Merge "Remove liblog from libcutils as a whole static lib" 2016-10-03 18:26:45 +00:00
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
Mark Salyzyn
ff2dcd9af9 system/core Replace log/log.h with android/log.h
Should use android/log.h instead of log/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I33a8fb4e754d2dc4754d335660c450e0a67190fc
2016-09-30 12:47:05 -07:00
Mark Salyzyn
23ed4c242a libcutils: Replace cutils/log.h with android/log.h
Replace references to cutils/log.h and log/log.h with android/log.h.
Point cutils/log.h to android/log.h. Adjust header order to comply
with Android Coding standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I4b00c0dff3a0a50cbb54301fdc5a6c29c21dab65
2016-09-30 12:47:05 -07:00
Connor O'Brien
a2d4a6b598 Merge "Add basic tests for ashmem" 2016-09-29 21:32:02 +00: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
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