- unlike base::WaitForProperty, which waits for specific value to
be set, this one only waits until the property is created.
bug: 35178781
Test: added unit test
Change-Id: Idbf98c2152fe768357302f6b69310c55305f5d54
Tests will often want to get the executable directory in order to
find test data.
Test: out/host/linux-x86/nativetest64/libbase_tests/libbase_tests
Change-Id: Ica9d211bcd039fcf83a22fd494816abd01b97aa3
adb already provides an implementation of dirname and basename that
take and produce std::strings, move it into libbase so it can be
used in the implementation of GetExecutableDirectory.
Test: out/host/linux-x86/nativetest64/adb_test/adb_test
Test: out/host/linux-x86/nativetest64/libbase_test/libbase_test
Test: adb shell /data/nativetest64/libbase_test/libbase_test64
Change-Id: Ideb1627607b14562121316d4ed27fa6fb0930684
Bionic has <sys/endian.h>, glibc <endian.h>, and macOS and Windows have
nothing. This has often been annoying.
Bug: N/A
Test: new tests
Change-Id: I2a40c570df6a9bb30607ace1af653265938cc4b8
Tests running in app context can't access /data/local/tmp,
so try current directory if /data/local/tmp is not accessible.
Bug: http://b/18790309
Test: run unit test in app context and shell context.
Change-Id: If66fe8f0ac3edb3a32a2a2a50a524364f818a58b
Use this for bootstat and init. This replaces the custom uptime parser in
bootstat.
This is a reland of aosp/332854 with a fix for Darwin.
Bug: 34352037
Test: chrono_utils_test
Change-Id: Ib2567d8df0e460ab59753ac1c053dd7f9f1008a7
ubsan doesn't like us incrementing std::string::npos, even if we won't use
the result.
Bug: http://b/28729303
Test: ran tests
Change-Id: I8227eca57dc6f3e49626c7025514caa04ef18f0a
Also adapt libcutils to the bionic change that was necessary for this.
Bug: http://b/35201172
Test: ran tests
Change-Id: I72a98b70b03d23e958b46778b505fbd5c86c32ae
Bug: http://b/31532493
Using misaligned pointers forces us to potentially take the address of
members in a packed structure (which is now a warning/error in the
latest Clang). Using memcpy() is the proper way to handle this kind of
problem, as the compiler can insert the proper instructions (and usually
elide the memcpy() entirely).
Test: Built correctly with updated compilers.
Change-Id: Ia1f6eb62cf19404ff76b71d3c6c7ffffa1403120
Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.
Correct liblog/README
Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.
Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
Undo zero-termination-substitution for linebreaks when logging.
This results in handing the complete log message to the aborter.
Add a test.
Bug: 31893081
Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64
Change-Id: I2ef6c6351db2fd494a02985f634f439104136227
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
Partially reverts commit 436f5a031f.
Remove the variants taking a fully qualified LogSeverity. Instead
use a lambda with "using" statements to translate both qualified
and unqualified names into valid expressions.
Compile-time regression was measured as 0.1s for a thousand LOG
statements on a z840.
Update tests.
Bug: 31338270
Test: m
Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64
Change-Id: I36fdf30a9d535b19543307b85d1b3c19a97f20dd
Makes it easier to write correct code in a world where the maximum
property key/value lengths change.
Bug: http://b/23102347
Test: libbase_test64
Change-Id: I100f00904221bbcef9e8786a4e6e30428039bb49
Add WOULD_LOG to determine whether a given severity would be logged.
Add LOG_STREAM to have direct access to a logging stream.
Add LOG_S variants that take a fully qualified severity. This allows
complex expressions as parameters, e.g., ternaries for conditional
severity levels.
Add tests.
Bug: 31338270
Test: m
Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64
Change-Id: I242b960594e68caff6db9cd8aaa4ce8aaf90474c