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
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
Remove debuggerd in favor of a helper process that gets execed by
crashing processes.
Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I9906c69473989cbf7fe5ea6cccf9a9c563d75906
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
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
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
Solve one more issue where privilege is required to open a file and
we do not want to grant such to the service. This is the client side
of the picture, init is the server. The file's descriptor was placed
into the environment as "ANDROID_FILE_<path>" where non-alpha and
non-numeric characters in the <path> are replaced with _ and this
function picks the file descriptor up.
Added definition ANDROID_FILE_ENV_PREFIX ("ANDROID_FILE_") and
android_get_control_file() prototype in a new include <cutils/files.h>
android_get_control_file() checks if the resulting file descriptor is
valid, open and matches the name reference, which on purpose will fail
if a symbolic link is in the path rather than using a fully qualified
path. Add gTest unit test for both.
Test: gTest libcutils_test --gtest_filter=FileTest.android_get_control_file
Bug: 32450474
Change-Id: I2d0310a1727f1e393a00d9fc7e6cf5d028f27905
We went too far, so this is a partial revert, part deux.
Keep general purpose logging macros in android/log.h for the NDK.
More internal features like Radio, System and Events logging are
moved back to log/log.h. Correct liblog ndk symbols. Correct for
some Android Coding standards.
Test: compile
Bug: 31992412
Change-Id: Id3731496fa226e8c170305d0d2a1859e8cf67e14
Test: manual - make sure it works in both IPv4/IPv6 env.
BUG: 31537253
Change-Id: Ica492bff34a8c0441516a213d0e8b78fcdfd3282
Signed-off-by: Tao Wu <lepton@google.com>
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
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
The warnings in these files were hidden by -isystem
framework/native/include.
Bug: 31752268
Test: m -j
Change-Id: I2a54376aea380ee24e6483fb7d35fdfe8991c490
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
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
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
system/core/include is included in the global include path using
-isystem, which hides all warnings. Fix warnings in cutils/atomic.h in
preparation for moving from -isystem to -I.
Test: m -j native
Bug: 31492149
Change-Id: I2a212f192309090a16d507e9ab6acf0fd7cac02d
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.