Commit graph

1131 commits

Author SHA1 Message Date
Mika Raento
2c2e3e89b0 Systrace support for NNAPI
Change-Id: I5abf283b5fb04725ec0b8ffbb8191fbddec1766b
Bug: 78137932
Test: mm
2018-04-26 09:34:22 +01:00
Elliott Hughes
9f49508f36 Rewrite get_sched_policy_name for safety.
This way you'll get a build time error if you make the usual mistake of
adding to the enum but not adding an entry to the array.

Also improve the unit tests, and fix get_sched_policy_name's incorrect
behavior on invalid inputs.

Bug: N/A
Test: ran tests
Change-Id: Iefcb1ec9ef66267837da7a576c8be3d0cfb16cd0
2018-04-25 14:55:48 -07:00
Tim Murray
419ba9e2aa cutils: add restricted cpuset
(cherrypick of 658ae90f69 without the init.rc change)

Bug: 78197570
Test: CTS
Change-Id: I6df972950b75a839caa463ae282ad000b959e8ae
2018-04-25 14:30:37 -07:00
Tim Murray
658ae90f69 cutils: add restricted cpuset
Bug 78197570
Test: CTS
Exempt-From-Owner-Approval: owner OOO, build cop says it's fine

Change-Id: I6df972950b75a839caa463ae282ad000b959e8ae
2018-04-18 16:42:12 -07:00
Mark Salyzyn
f089e1403b llkd: add live-lock daemon
Introduce a standalone live-lock daemon (llkd), to catch kernel
or native user space deadlocks and take mitigating actions.  Will
also configure [khungtaskd] to fortify the actions.

If a thread is in D or Z state with no forward progress for longer
than ro.llk.timeout_ms, or ro.llk.[D|Z].timeout_ms, kill the process
or parent process respectively.  If another scan shows the same
process continues to exist, then have a confirmed live-lock condition
and need to panic.  Panic the kernel in a manner to provide the
greatest bugreporting details as to the condition.  Add a alarm self
watchdog should llkd ever get locked up that is double the expected
time to flow through the mainloop.  Sampling is every
ro.llk_sample_ms.

Default will not monitor init, or [kthreadd] and all that [kthreadd]
spawns.  This reduces the effectiveness of llkd by limiting its
coverage.  If in the future, if value in covering kthreadd spawned
threads, the requirement will be to code drivers so that they do not
remain in a persistent 'D' state, or that they have mechanisms to
recover the thread should it be killed externally.  Then the
blacklists can be adjusted accordingly if these conditions are met.

An accompanying gTest set have been added, and will setup a persistent
D or Z process, with and without forward progress, but not in a
live-lock state because that would require a buggy kernel, or a module
or kernel modification to stimulate.

Android Properties llkd respond to (*_ms parms are in milliseconds):
- ro.config.low_ram default false, if true do not sysrq t (dump
  all threads).
- ro.llk.enable default false, allow live-lock daemon to be enabled.
- ro.khungtask.enable default false, allow [khungtaskd] to be enabled.
- ro.llk.mlockall default true, allow mlock'd live-lock daemon.
- ro.khungtask.timeout default 12 minutes.
- ro.llk.timeout_ms default 10 minutes, D or Z maximum timelimit,
  double this value and it sets the alarm watchdog for llkd.
- ro.llk.D.timeout_ms default ro.llk.timeout_ms, D maximum timelimit.
- ro.llk.Z.timeout_ms default ro.llk.timeout_ms, Z maximum timelimit.
- ro.llk.check_ms default 2 minutes sampling interval
  (ro.llk.timeout_ms / 5) for threads in D or Z state.
- ro.llk.blacklist.process default 0,1,2 (kernel, init and
  [kthreadd]), and process names (/comm or /cmdline) init,[kthreadd],
  lmkd,lmkd.llkd,llkd,[khungtaskd],watchdogd,[watchdogd],
  [watchdogd/0] ...
- ro.llk.blacklist.parent default 0,2 (kernel and [kthreadd]) and
  "[kthreadd]".  A comma separated lists of process ids, /comm names
  or /cmdline names.
- ro.llk.blacklist.uid default <empty>, comma separated list of
  uid numbers or names from getpwuid/getpwnam.

Test: llkd_unit_test
Bug: 33808187
Bug: 72838192
Change-Id: I32e8aa78aef10834e093265d0f3ed5b4199807c6
2018-04-18 14:01:56 -07:00
Mark Salyzyn
64d97d8761 lmkd: limit capability set to minimum
Set F() capability set and 'drop' lmkd from AID_ROOT to AID_LMKD uid
and from AID_ROOT to AID_LMKD and AID_SYSTEM gid.

/dev/memcg/memory.pressure defaults to root.root mode 0000, set it up
as root.system mode 0040 to allow lmkd read access.

Instrument failure to set SCHED_FIFO.

Annotate access points that require elevated capabilities.

Test: check /proc/`pidof lmkd`/status for capability set
Test: lmkd_unit_test
Bug: 77650566
Change-Id: I986081a0434cf6e842b63a55726380205b30a3ea
2018-04-16 14:51:56 -07:00
Tom Cherry
07aa2a6131 Remove vendor Wifi and BT entries from fs_config.cpp
Their capability bits are now specified in their associated init .rc
file, which is the proper place for this to be done.

A notice is added to guide developers away from using android_files to
give services Linux capabilities and to guide them away from adding
vendor/ entries.

Bug: 74554159
Test: BT, Wifi, Tethering work on walleye
Merged-In: I13c425d022b4f5c217587cdf601884ef44650ac7
Change-Id: I13c425d022b4f5c217587cdf601884ef44650ac7
(cherry picked from commit b5e5c56401)
2018-04-05 10:40:49 -07:00
Tom Cherry
b5e5c56401 Remove vendor Wifi and BT entries from fs_config.cpp
Their capability bits are now specified in their associated init .rc
file, which is the proper place for this to be done.

A notice is added to guide developers away from using android_files to
give services Linux capabilities and to guide them away from adding
vendor/ entries.

Bug: 74554159
Test: BT, Wifi, Tethering work on walleye
Change-Id: I13c425d022b4f5c217587cdf601884ef44650ac7
2018-03-29 14:10:12 -07:00
Treehugger Robot
61896fc0ee Merge "Enabled SYS_MODULE capability for wifi@1.0-service" 2018-03-29 20:57:42 +00:00
Ajit Kumar
b0fc2d743b Enabled SYS_MODULE capability for wifi@1.0-service
Add sys_module capability to enabled insmod operation.

Merged-In: I6436c3297e5318bd00ae3582549a11cb82ccbafd
Change-Id: I6436c3297e5318bd00ae3582549a11cb82ccbafd
(cherry picked from commit c2a059fbf0)
2018-03-29 19:34:06 +00:00
Tom Cherry
666464a180 Revert "fs_config: Move hostapd to /vendor/bin/hw"
This reverts commit 656b75c77c.

Capability bits are moving from fs_config.cpp to the associated init
scripts for daemons on /vendor.

Bug: 74554159
Test: wifi tethering works on walleye
2018-03-28 18:29:02 +00:00
Martijn Coenen
24426e96a5 Add new trace tag for AIDL.
So we can auto-generate tracing code for AIDL interfaces.

Bug: 74416314
Test: inspect atrace output
Change-Id: I91b14b3b16d8d7a29f531101b14ddf10dbc61a5a
Merged-In: I91b14b3b16d8d7a29f531101b14ddf10dbc61a5a
2018-03-26 09:59:21 +02:00
Martijn Coenen
07b98d9b97 Add new trace tag for AIDL.
So we can auto-generate tracing code for AIDL interfaces.

Bug: 74416314
Test: inspect atrace output
Change-Id: I91b14b3b16d8d7a29f531101b14ddf10dbc61a5a
2018-03-21 13:59:34 +01:00
Robert Sesek
f29ce0ff7c Merge "Remove fs_config entries for webview_zygote." am: 47354e76eb am: 19fafd1ae9
am: b13b9e0d55

Change-Id: I970fb49989763bde055922f8f6c59e89450a83ee
2018-02-23 17:55:05 +00:00
Alexey Kuzmin
8166a93899 Merge "Add tracing tags to vibrator" am: c415d00fbe am: 0f71d5fe53
am: f2b8913c4f

Change-Id: I2c90c90bfc08875b2cb58d8a8cc8bec414164438
2018-02-15 14:17:57 +00:00
Robert Sesek
84e8a3811f Remove fs_config entries for webview_zygote.
This process is now spawned from the main app_process zygote, rather
than being its own binary launched by init.

Bug: 63749735
Test: m
Change-Id: I87e00197e1ce64d77b4c306fcd702c6ad778b236
2018-02-14 17:42:03 -05:00
Alexey Kuzmin
3b5aebb046 Add tracing tags to vibrator
Now all somewhat time-consuming methods of the VibratorService
are surrounded by traceBegin/traceEnd blocks.
The vibration itself is surrounded with asyncTrace block.

Test: Run "systrace vibrator" and see the time consumption report.
Bug: 73000045
Merged-In: I94172e379354ec3418321b8151e6182cec2e886c
Change-Id: I94172e379354ec3418321b8151e6182cec2e886c
2018-02-13 18:29:40 +00:00
Daniel Colascione
d49fb1238d Merge "Support * as a wildcard for ATRACE_TAG_APP" am: 53c964f53b am: 2e50045f60
am: 34499aab21

Change-Id: Ie8e78dc2f85c513ba4ba8b4a355a7d4de1e1055d
2018-02-12 23:27:14 +00:00
Ajit Kumar
c2a059fbf0 Enabled SYS_MODULE capability for wifi@1.0-service
Add sys_module capability to enabled insmod operation.

Change-Id: I6436c3297e5318bd00ae3582549a11cb82ccbafd
2018-02-12 18:31:47 +00:00
Daniel Colascione
642ef98b3b Support * as a wildcard for ATRACE_TAG_APP
Test: strcmp
Change-Id: I33ec3ae071e3856538444663bbabb3c779ed8afa
2018-02-09 20:08:19 -08:00
Paul Crowley
c67fd14fd1 Merge "Revert "Don't initialize atrace if it's already disabled."" am: c50d19c0b0 am: 33d3758684
am: 006cd45c86

Change-Id: I1f9e10da302fdb6b0a427dae321551f8e3744f7a
2018-02-08 17:46:30 +00:00
Treehugger Robot
c50d19c0b0 Merge "Revert "Don't initialize atrace if it's already disabled."" 2018-02-08 17:27:41 +00:00
Paul Crowley
738adf7b46 Revert "Don't initialize atrace if it's already disabled."
This reverts commit e184423526.

Reason for revert: b/73081734
Bug: 73081734

Change-Id: I8ae835f5575292ebd3c4457ef26c2e8f98cfa11e
2018-02-08 00:49:37 +00:00
Mark Salyzyn
1e330b0376 Merge "libcutils: Add "daemon" and "bin" users for testing only" am: 718899b415 am: 2500e38093
am: 451ff596cf

Change-Id: Id2abde064963cbb68929c76ff5a47d4f52995190
2018-02-06 04:29:47 +00:00
Mark Salyzyn
8e8648463d libcutils: Add "daemon" and "bin" users for testing only
Multiple LTP tests require a "daemon" or "bin" user.  These user ids
have been defined since UNIX incept, and even up to the '80s remained
in many of the tools as hard coded values.  Add these two ids with
a cautionary note.

Test: compile
Bug: 31152327
Bug: 31226046
Bug: 32385889
Change-Id: Ida2fb6d817b8ada0624870439fcf848667b31fb3
2018-02-05 11:06:08 -08:00
Mark Salyzyn
eac8700cbb Merge "libcutils: test: increase use of ashmem_valid(fd)" am: dd218e6c84 am: 9f3a257536
am: 43f2c5cf38

Change-Id: I5e7b0994b76afbc60446518d08fe36dbf02f3fe5
2018-01-31 17:52:43 +00:00
Treehugger Robot
dd218e6c84 Merge "libcutils: test: increase use of ashmem_valid(fd)" 2018-01-31 17:35:29 +00:00
Paul Crowley
8645dd1204 Merge "Don't initialize atrace if it's already disabled." am: 0e239bbd8b am: 2fc40a6518
am: 65c685e204

Change-Id: I1ab9cff70cd461069f2db651ab96f449aae4666e
2018-01-30 22:14:34 +00:00
Paul Crowley
e184423526 Don't initialize atrace if it's already disabled.
For processes that start very early, atrace initialization can cause
an selinux denial, so make sure it's possible to disable it and avoid
the call to open "trace_marker".

Bug: 63927601
Test: disable atrace early in vold, ensure that selinux denial is
avoided.

Change-Id: I2422e6d0db323bc13c6d6ed1896435151fca21f7
2018-01-30 08:18:24 -08:00
Ruchi Kandoi
838c985416 Merge "Add AID for Secure Element Application" am: d3e7e31d28 am: 66c3eb0e45
am: f9ae0b10e0

Change-Id: I81e91a74c81a8e9854b1f4bab26ed03f033801c6
2018-01-26 20:02:54 +00:00
Mark Salyzyn
276758dab8 libcutils: test: increase use of ashmem_valid(fd)
There may be evidence of ashmem_valid(fd) reporting that the file
descriptor is an ashmem node.  Increase testing of ashmem_valid(fd),
reporting that the node _is_ ashmem, to inspire confidence in the
positive result.  Scan all file descriptors in the system, and for
those that pass ashmem_valid, get a non-zero size reference back.

Some clang-format-isms applied.

Test: libcutils-test --gtest_filter=AshmemTest.*
Bug: 72021458
Change-Id: I77d746b57a89a6afa1b829dddfdc4dd319f6b684
2018-01-26 09:50:57 -08:00
Ruchi Kandoi
d506c068d4 Add AID for Secure Element Application
Test: Test if the correct uid is assigned to the application
Change-Id: Ib0302a2e90ae89499ecbcebffa393bdd037adfbe
2018-01-25 18:21:53 +00:00
Jaekyun Seok
207a211804 Merge "Support /product partition" am: 8f324542a2 am: 10e1ec7de3
am: 83ffef2cb1

Change-Id: Ia1933bbede3db2489151e5ab8ead574582b87f7a
2018-01-25 04:17:36 +00:00
Jaekyun Seok
dff165d3a2 Support /product partition
This CL will enable reading /product/build.prop and add product paths
into ld.config.txt.in.

Bug: 64195575
Test: tested with 'PRODUCT_PRODUCT_PROPERTIES := ro.product.abc=abc' on
sailfish

Change-Id: Ie996def20e25dc1afe0c74af2096af844934b2dc
2018-01-25 09:37:20 +09:00
Roshan Pius
656b75c77c fs_config: Move hostapd to /vendor/bin/hw
Bug: 36646171
Test: Able to turn on softap
Change-Id: Ibd82581a12b4bd2e7d22825361706e35f292ce2b
2018-01-16 12:38:04 -08:00
Yi Jin
31b506679b Add AID_STATSD and AID_INCIDENTD for statsd/incidentd daemons.
Test: manual
Change-Id: Id798519c3b0116529fc698e6b316a1c6b1c293ca
2018-01-09 14:17:50 -08:00
Treehugger Robot
f008571a4f Merge "libcutils: Stop checking the uid of netlink messages" 2018-01-09 17:35:31 +00:00
Treehugger Robot
affd4e9bd9 Merge "Use override_export_include_dirs." 2018-01-08 22:15:51 +00:00
Luis Hector Chavez
84c99136fd libcutils: Stop checking the uid of netlink messages
This is a partial revert of
https://android-review.googlesource.com/c/platform/system/core/+/528619.
The uid-check was done before
https://patchwork.kernel.org/patch/1525551/ was available, and thus is
now unnecessary to perform such check, since we can just rely on the
kernel patch now.

Bug: 71632076
Test: aosp_sailfish-userdebug still works

Change-Id: I1d1319b774483d1714ecb4dd838a20e055acc2a3
2018-01-08 13:24:32 -08:00
Jeff Sharkey
354417a7fb Allocate GID to use reserved disk space.
Filesystems allow the setting of the "resgid" parameter to designate
a GID that is allowed to use the "reserved" disk space (in addition
to UID 0).  We'll be granting this GID to critical system processes,
so that the system is usable enough for the user to free up disk
space used by abusive apps.

Test: builds, boots
Bug: 62024591
Change-Id: I2d166f3b730f0a3e7279fb40f12db7413c1dadad
2018-01-07 19:21:51 -07:00
Steven Moreland
e1c834db04 Use override_export_include_dirs.
Bug: 62878521
Test: soong build system finds renamed attribute
Change-Id: I51e42f4378db366b8711cd373fb835fecda88416
2018-01-05 14:42:12 -08:00
Elliott Hughes
579e682628 Add std::string StartsWith*/EndsWith* overloads.
We should have done this from the beginning. Thanks to Windows, we're not
going to be able to switch libbase over to std::string_view any time soon.

Bug: N/A
Test: ran tests
Change-Id: Iff2f56986e39de53f3ac484415378af17dacf26b
2017-12-20 09:42:22 -08:00
Elliott Hughes
38d2567c9f Stop defining local "unused" macros now this is C++.
Bug: N/A
Test: builds, boots
Change-Id: I3eb075d5003fa7cdc6690f4af29a296e22be257c
2017-11-30 16:24:36 -08:00
Dan Willemsen
528f144e77 Fix / suppress new unused warnings for mingw+clang
Bug: 69933068
Test: mmma system/core
Change-Id: I089166a979d3d8c5ada38a7745d507b555048499
2017-11-29 21:37:28 -08:00
Jeff Sharkey
53d37ba23f Better, consistent definition of AID_SHARED_GID.
AID_SHARED_GID is a GID shared by a specific app across all users on
the same device.  Bring the UserHandle and multiuser.c implementations
into agreement, and copy/paste the unit tests that verify that both
behave identically.

This fixes a regression where multiuser_get_shared_gid() was applying
per-user isolation when it shouldn't have.

Test: adb shell /data/nativetest64/libcutils_test/libcutils_test64
Bug: 34151068, 64548938
Change-Id: I491dd79d23a214425a68865d1d0f8269916aad4c
2017-11-13 16:49:26 -07:00
Elliott Hughes
1412f5ffe3 Remove dead dlmalloc stubs.
Used to be used by ART, but long gone.

Bug: N/A
Test: ran tests
Change-Id: Id231d97b2b797562619e6fd90536b17dbe39f71e
2017-11-10 16:24:18 -08:00
Elliott Hughes
8e9aeb9053 Move libcutils source to C++.
Just the minimial changes to get this to actually build, because otherwise
we always bog down trying to rewrite everything (when the real answer
is usually "stop using libcutils, it's awful").

This doesn't move a handful of files: two are basically just BSD libc
source, a couple have outstanding code reviews, and one can be deleted
(but I'll do that in a separate change).

I'm also skipping the presubmit hooks because otherwise clang-format
wants to reformat everything. I'll follow up with that...

Bug: N/A
Test: builds
Change-Id: I06403f465b67c8e493bad466dd76b1151eed5993
2017-11-10 13:18:10 -08:00
Treehugger Robot
6707ef139d Merge changes from topic "qtaguidReplace"
* changes:
  Redirect qtaguid native call to netd fwmark client
  Move qtaguid API out of libcutils
2017-11-10 18:34:36 +00:00
Chenbo Feng
baede73bd9 Redirect qtaguid native call to netd fwmark client
In order to replace qtaguid module with new eBPF network monitoring
module. We firstly move the current qtaguid userspace implementation
into netd and hide the detail from other processes. The current API will
talk to netd fwmark client to pass down the qtaguid related request from
high level framework and netd will use the proper method to complete the
request.

Test: Current TrafficStats CTS tests should not fail.
Bug: 30950746
Change-Id: Ie90c28f3594ab2877746b2372a1b6944768bfb18
2017-11-09 18:02:22 -08:00
Chenbo Feng
5b11831aa1 Move qtaguid API out of libcutils
The qtaguid kernel module will be deprecated on devices running 4.9
kernel or above and we need to support both old and new module in
userspace. Netd is responsible for choosing which kernel module to use
and all the current qtaguid native implementation need to be hided
behind it. So the current qtaguid native API implementation will be
moved to a isolate library under system/core and only netd can access to
it. The libcutils qtaguid API will become a wrapper to send request to
netd module. This modification will make sure the apps that currently
using this native API will not be broken.

Bug: 30950746
Test: All cts and vts test related should not fail.
Change-Id: I9de98a25ed5dc71bbf520ee0aadd16d59025699a
2017-11-08 16:28:43 -08:00
Luis Hector Chavez
fae195b1e4 libcutils: Work around the lack of __mulodi4
The parent change ran into an issue where enabling UBSan on an i686
build caused it to use __mulodi4.

https://github.com/android-ndk/ndk/issues/184 documents linking against
libclang_rt.builtins-i686.a, but that's not available from soong either.

Bug: 62378620
Bug: 29412086
Test: x86 builds work again
Change-Id: I730d59558aa4ed28f8a11b5393e037111e320f29
2017-11-04 00:36:01 +00:00
Luis Hector Chavez
e97a4b9799 libcutils: Make uevent_kernel_* namespace-aware
This change adds user namespace-awareness to uevent_kernel_* in
libcutils. Instead of assuming that root is always uid 0, it detects
whether the uid 0 is mapped in the current user namespace and returns
the appropriately mapped uid (or the kernel's "overflowuid" in case it
is not mapped).

In older kernels, or those where user namespaces are not enabled, this
still uses uid 0 for root.

Bug: 62378620
Test: bullhead networking still works
Test: Android in Chrome OS can now receive netlink-related messages

Change-Id: I7ea3454e8f38b9c70c65294d6b2a99e5a88f9d70
2017-11-03 13:02:46 -07:00
Christopher N. Hesse
bdee15ef71 Merge "libcutils: Fix thread ID on macOS"
am: 6958506e82

Change-Id: If328ec31ff2d52b0852fb8e2eb2e061564504586
2017-10-23 20:32:47 +00:00
Christopher N. Hesse
684b442b9f libcutils: Fix thread ID on macOS
macOS 10.12 / Xcode 8 actively prohibit the syscall(2)
usage.

Change-Id: I91ff16600a76e97d0b9b5db7e8905b969fb3482f
2017-10-22 22:58:41 +02:00
Elliott Hughes
bb5ec4a926 resolve merge conflicts of 796987482 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ica884c137c5f21e261600b2b011ab963036c0cdb
2017-10-17 12:36:14 -07:00
Treehugger Robot
796987482f Merge "<stdbool.h> not necessary in C++." 2017-10-17 19:26:53 +00:00
Elliott Hughes
a0f73f9bff <stdbool.h> not necessary in C++.
Bug: N/A
Test: builds
Change-Id: I1f32b202e353414e74ace87a7d5b495b5deb5f99
Merged-In: I1f32b202e353414e74ace87a7d5b495b5deb5f99
2017-10-17 16:21:33 +00:00
Nick Kralevich
7e772f8194 Merge "set O_CLOEXEC on /dev/ashmem"
am: be729702ae

Change-Id: Ib308d27bd05d9d824772ab76564b2ed1487e09d3
2017-10-09 22:59:32 +00:00
Nick Kralevich
30046acdb2 set O_CLOEXEC on /dev/ashmem
Ensure FDs don't leak across exec() boundaries.

Test: builds and boots. No obvious issues.
Change-Id: I00347b489ddb146b9d33442626f0e89a6cf26551
2017-10-09 13:19:36 -07:00
Bowgo Tsai
d29ac08509 Merge "Removing $(PRODUCT_OUT)/root/root"
am: 8cbbacdc15

Change-Id: Ia671976f8d7d4b83478c58d566e309f36af125ab
2017-09-29 03:27:38 +00:00
Bowgo Tsai
144893e5ec Removing $(PRODUCT_OUT)/root/root
Bug: 65570851
Test: boot sailfish
Change-Id: I80c3c3de23c57343187fde207980731b5341bc1f
Merged-In: I80c3c3de23c57343187fde207980731b5341bc1f
(cherry picked from commit ededee3e40)
2017-09-28 18:10:58 +08:00
Mark Salyzyn
6818f80dbb Merge changes from topic "b/63736262"
am: 1f666a6be9

Change-Id: I2586aac3d6fe8252ee6728de64fb37102accf0da
2017-09-13 22:45:52 +00:00
Mark Salyzyn
b304f6d4e7 bootstat: introduce sys.boot.reason
Adding functionality to bootstat --record_boot_complete and
--record_boot_reason to initialize sys.boot.reason, the canonical
system boot reason.

Filter out ro.boot.bootreason oem noise into sys.boot.reason.  Add
heuristics to determine what the boot reason is, when otherwise would
be defaulting to the blunt and relatively devoid of detail catch-all
reboot reasons ("reboot", "shutdown", "cold", "warm", "hard").

boot_reason_test.sh is also a compliance test.

Test: boot_reason_test.sh all
Bug: 63736262
Change-Id: Ic9a42cccbcfc89a5c0e081ba66d577a97c8c8c76
2017-09-12 09:28:25 -07:00
Mark Salyzyn
37c6015d9d Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property"
am: 13cb599536

Change-Id: Ib6c1b51668b892288db931b09b099bf5ed28fbae
2017-08-25 14:24:21 +00:00
Mark Salyzyn
73e6b49c0c Switch /data/misc/reboot/last_reboot_reason to persistent property
Switch from /data/misc/reboot/last_reboot_reason to persistent
Android property persist.sys.boot.reason for indicating why the
device is rebooted or shutdown.

persist.sys.boot.reason has a standard as outlined in b/63736262 and
the associated investigation. Made adjustments to the values so that
we did not create a problem even before we started. Compliance is
part of the tests in boot_reason_test.sh.

Test: system/core/bootstat/boot_reason_test.sh
Bug: 64687998
Change-Id: I812c55a12faf7cb7ff92101009be058ad9958d07
2017-08-24 15:13:48 -07:00
Justin Yun
028664fcd3 Merge "Mark the modules as VNDK-SP in Android.bp"
am: bc9924ed40

Change-Id: I5f4802a063a1184ab1d246b3e81211923ab83853
2017-08-23 23:23:26 +00:00
Justin Yun
9ca92458e2 Mark the modules as VNDK-SP in Android.bp
As a VNDK-SP module, Android.bp must have 'vndk' tag as well as
'vendor_available: true'.

The 'vndk' tag for VNDK-SP formated as follows:
vndk: {
    enabled: true,
    support_system_process: true,
},

VNDK-SP modules will be installed both in system/lib(64) as normal
and in system/lib(64)/vndk-sp as a vendor variant.

Bug: 63866913
Test: build and boot with BOARD_VNDK_VERSION=current
Merged-In: I51fe0859f63ad58b7b91909e7d7d4206443228cd
Change-Id: I51fe0859f63ad58b7b91909e7d7d4206443228cd
(cherry picked from commit aeb68e86e4)
2017-08-23 17:56:13 +09:00
Andrew Scull
e05c35a10b Merge "Add HSM AID." am: 4723d7c66d am: ef1dd0d279
am: a3f425950c

Change-Id: Iabda5247da9a91648772165eb24b5df5bf7e553d
2017-08-10 21:43:47 +00:00
Andrew Scull
a3f425950c Merge "Add HSM AID." am: 4723d7c66d
am: ef1dd0d279

Change-Id: I3b00e1fd0761e9d9daa439cf1ca5eedc0eab84fb
2017-08-10 21:39:47 +00:00
Andrew Scull
ef1dd0d279 Merge "Add HSM AID."
am: 4723d7c66d

Change-Id: If7075378ac5a13bbe79a02843d13d34c5f128d2a
2017-08-10 21:35:47 +00:00
Andrew Scull
f73c5e1f84 Add HSM AID.
This is used by resources related to a hardware security module (HSM).

Bug: 64569509
Change-Id: I30d47e1b275e3c4ae0a00f7ceb286a1096d84273
2017-08-10 20:25:11 +01:00
Robert Quattlebaum
228123a5c8 Merge "Add AID for LoWPAN subsystem" am: f602dd4ced am: 4ff32084d5
am: 91f952dda0

Change-Id: I49a6c9c9db980910a0d2d9289ca1a123f21f3eed
2017-08-08 00:00:55 +00:00
Robert Quattlebaum
91f952dda0 Merge "Add AID for LoWPAN subsystem" am: f602dd4ced
am: 4ff32084d5

Change-Id: Ib4ff4c6eee71e1bf189e5cb945405cd679d77112
2017-08-07 23:56:49 +00:00
Robert Quattlebaum
4ff32084d5 Merge "Add AID for LoWPAN subsystem"
am: f602dd4ced

Change-Id: Idd091e64fd9cab58f38da67e0b32e0aa9c98fb7d
2017-08-07 23:55:19 +00:00
Robert Quattlebaum
01f7576a3e Add AID for LoWPAN subsystem
Bug: b/64399805
Change-Id: Ida6aa60d8beee9151a723826d99c1e9044dc05be
2017-08-04 16:19:34 -07:00
Earl Ou
9435b3ed44 Merge "libcutils: write trace event into socket in container" am: 59b33cb01c am: 08d9cc3744
am: 6cc4df26d6

Change-Id: Ib4a23ef6f3644afe76e6615bdc1be0e4fd7f909c
2017-08-04 01:16:12 +00:00
Earl Ou
6cc4df26d6 Merge "libcutils: write trace event into socket in container" am: 59b33cb01c
am: 08d9cc3744

Change-Id: Ie6f05ca73b0391f6b739e43cf0920d5c52c0d882
2017-08-04 01:10:12 +00:00
Earl Ou
08d9cc3744 Merge "libcutils: write trace event into socket in container"
am: 59b33cb01c

Change-Id: Ie59769f5820a8bb5991ba3dca53df83c5e90f795
2017-08-04 01:04:15 +00:00
Treehugger Robot
59b33cb01c Merge "libcutils: write trace event into socket in container" 2017-08-04 00:50:59 +00:00
Yifan Hong
8a05dd0472 Merge changes from topic 'libcutils_private_headers' am: 472808a570 am: 6c2d927c34
am: 2615527f08

Change-Id: I433589f4691d74f8fcd2a30ad34ab817e9b6a36d
2017-08-03 20:47:53 +00:00
Yifan Hong
2615527f08 Merge changes from topic 'libcutils_private_headers' am: 472808a570
am: 6c2d927c34

Change-Id: I0718ab31e074b716f9be50a25330ffa8bdaae47d
2017-08-03 20:41:40 +00:00
Yifan Hong
6c2d927c34 Merge changes from topic 'libcutils_private_headers'
am: 472808a570

Change-Id: Ia4963b1b2c50bdcc3d9ccc6a954a465cbf9b5de0
2017-08-03 20:34:31 +00:00
Yifan Hong
472808a570 Merge changes from topic 'libcutils_private_headers'
* changes:
  Remove private headers from libcutils.vendor
  Move android_filesystem_config.h => fs_config.h
2017-08-03 18:24:04 +00:00
Earl Ou
e4030384c4 libcutils: write trace event into socket in container
When Android is running in a container, ftrace trace_marker may be
disabled, e.g. Chrome OS verified mode. To enable trace, a socket is
created for everyone to send trace event.

Modify libcutils so apps using it can write trace to the socket.

To achieve this goal without touching code for normal device,
trace-container.c is created for code specific to container. Shared
code between trace-dev.c and trace-container.c is moved to local
trace-dev.h.

Note that to avoid sharing FDs across different processes, Zygote closes
FD and reopen it to /dev/null if it is a socket. Therefore, we need to
manually close FD and reopen it again after forking. This is done in
the atrace_set_tracing_enabled as Zygote also use it to clear flags
during forking.

Related change:
- http://crrev.com/2400163003 (Chromium)
- http://ag/2028075 (Android system/core)
- http://ag/1738271 (Android device/google/cheets2)

Bug: 29776474, 62410809
Test: run chrome://tracing and see data from the host side.
Change-Id: I3fe969e284b972c28e4f32f23cd948aaea61a043
2017-08-03 15:16:44 +08:00
George Burgess IV
c3bc295f11 Merge "cutils: update property_get to use diagnose_if." am: 5c655991f5 am: f5a677a7d3
am: 2bf647ae24

Change-Id: Ib4561d402548195772757b83dc0638c28682dd5a
2017-08-03 02:33:22 +00:00
George Burgess IV
2bf647ae24 Merge "cutils: update property_get to use diagnose_if." am: 5c655991f5
am: f5a677a7d3

Change-Id: I39671d3f090f605d2f9ba3636c342ab5ee46c6bc
2017-08-03 02:28:23 +00:00
George Burgess IV
f5a677a7d3 Merge "cutils: update property_get to use diagnose_if."
am: 5c655991f5

Change-Id: I7dff3fb2ff288800d72d9c632617639fa7e6bf9e
2017-08-03 02:23:30 +00:00
Treehugger Robot
5c655991f5 Merge "cutils: update property_get to use diagnose_if." 2017-08-03 02:15:54 +00:00
Yifan Hong
b6807125df Remove private headers from libcutils.vendor
Bug: 63135587
Test: m -j
Test: BOARD_VNDK_VERSION=current m -j
Test: mma -j
Test: BOARD_VNDK_VERSION=current mma -j

Change-Id: I9eecf23c4c311bd8336a5bfaaeb2afb3b51c6513
Merged-In: I9eecf23c4c311bd8336a5bfaaeb2afb3b51c6513
2017-08-02 16:40:36 -07:00
Yifan Hong
09c89672b6 Move android_filesystem_config.h => fs_config.h
The non AID_ things in android_filesystem_config.h are moved
to fs_config.h. For libcutils.vendor and libcutils_headers.vendor,
fs_config.h is not exported.

An empty system/core/include/private/fs_config.h is placed to
appease the dependency from certain modules (logd, etc.)
that includes system/core/include/private/android_filesystem_config.h
directly.

Test: m -j
Test: BOARD_VNDK_VERSION=current m -j
Bug: 63135587
Change-Id: I95dfb874a426941022b100c0ca26a0576b0f4aa3
Merged-In: I95dfb874a426941022b100c0ca26a0576b0f4aa3
2017-08-02 16:31:19 -07:00
Elliott Hughes
78bc132d32 Merge "Make sure freeaddrinfo is always called on failure." am: f914029057 am: 9e1173aa40
am: 84cd98ceb0

Change-Id: I3d36bf694b20cf423cf1b3b5f647f7e907f20703
2017-08-02 23:28:54 +00:00
Elliott Hughes
84cd98ceb0 Merge "Make sure freeaddrinfo is always called on failure." am: f914029057
am: 9e1173aa40

Change-Id: Ib7936a9034467c38a58b5066472cdd5187a0e1b2
2017-08-02 23:22:36 +00:00
Elliott Hughes
9e1173aa40 Merge "Make sure freeaddrinfo is always called on failure."
am: f914029057

Change-Id: Iff3b186c35bca1f1c7292f5e5567d3ce11037239
2017-08-02 23:10:59 +00:00
George Burgess IV
9bf11c1d05 cutils: update property_get to use diagnose_if.
This lets us redeclare property_get with diagnose_if tagged on it,
so we no longer need to deal with overloads.

Bug: 12231437
Test: m checkbuild on bullhead aosp-master.
Change-Id: Ic55dcfeaa314f83d3713aabac7852cb766330fc8
2017-08-02 15:59:19 -07:00
Elliott Hughes
3ff453aaa0 Make sure freeaddrinfo is always called on failure.
Bug: https://android-review.googlesource.com/#/c/platform/system/core/+/268797/2/libcutils/socket_network_client_unix.c
Test: builds
Signed-off-by: Ivan Maidanski <i.maidanski@samsung.com>
Change-Id: I2d93c8359c3398769d408284f77d56e09713a7f3
2017-08-02 20:32:27 +00:00
Chih-Hung Hsieh
c3357de3fd Merge "Fix misc-macro-parentheses warnings in system/core." am: e4bd153e55 am: dfaa20c069
am: 3d0ff4ee98

Change-Id: Id161056885d346583e66ca49bf10934bc01e619f
2017-08-01 23:34:26 +00:00
Chih-Hung Hsieh
3d0ff4ee98 Merge "Fix misc-macro-parentheses warnings in system/core." am: e4bd153e55
am: dfaa20c069

Change-Id: I2a2376e19bdd415f784f708e2b8c910734e866a9
2017-08-01 23:29:59 +00:00
Chih-Hung Hsieh
dfaa20c069 Merge "Fix misc-macro-parentheses warnings in system/core."
am: e4bd153e55

Change-Id: I6b38149a0fa15874eff68cbf7ee62e4acd41c595
2017-08-01 23:26:06 +00:00
Chih-Hung Hsieh
85244e8bc2 Fix misc-macro-parentheses warnings in system/core.
Add NOLINT comment to work around clang-tidy
error in checking macro arguments used in
type expressions.

Bug: 28705665
Test: make with WITH_TIDY=1 WITH_TIDY_CHECKS=-*,misc-macro-* \
      WITH_TIDY_FLAGS=-header-filter=system/core/.*

Change-Id: I7619978c1804e151a11a8b0477e80076bcf21cab
2017-08-01 22:12:57 +00:00
Lennart Wieboldt
e1332dd01b Merge "Remove LOCAL_CLANG and clang: true" am: 80ec81cf4b am: f7b315c985
am: 8a8b97b271

Change-Id: I7e691abe2e2ccec5d9477c528d603c081c0a5661
2017-07-25 22:35:56 +00:00