Previously this test would rely on ro.debuggable being true, but there
are now some circumstances where ro.debuggable is true, yet `su` does
not exist. Therefore we only run this test when it is root.
Also simplify some of the test macros.
Bug: 140446213
Test: passes as root, skips as non-root
Change-Id: I0651963d5c7d4f5308989ab6b04aab1042094e5a
liblog has left over code from local_logger that allows for reading
from multiple sources and merging the contents. Since we've already
removed local_logger, this change removes the rest of this code.
Test: liblog-unit-tests
Change-Id: I5685ad6c1e7cbcaa0a660ed10f47714784a40791
Some tests were meant to be run with logd only and were ifdef'ed based
on USING_LOGGER_DEFAULT. Unfortunately a previous change removed the
appropriate #define, so these tests weren't being run at all. They
passed multiple times on CF, so they should still be stable.
Except for one test for __android_log_event_list. We removed that
struct, so this change removes the test as well.
Test: liblog-unit-tests on CF (5 runs)
Change-Id: Ifaf3dbfdc5c714aead3f26c333e9cf19a1ed86c6
Enable native bridge support for libbase, liblog,
libziparchive and libpropertyinfoparser.
This makes it possible to use them in binaries for translated
architectures.
Bug: http://b/77159578
Test: make
Change-Id: If67ce92288b17a052ea1e79a268e284f7d941439
This started as a change to use mbrtowc() instead of
utf8_character_length() as mbrtowc() does everything that
utf8_character_length() intends to do, but is a libc function. The
change was further intended to add unit tests to ensure that these
functions operate as intended.
It turns out that utf8_character_length() returned an error for the
utf8 characters that I tested, so this also has the side effect of
allowing valid utf8 characters to be printed in the 'printable' log
format, which was the original intention.
Also, print the binary data as hex instead of octal, since it is a
more suitable choice.
Test: new unit tests, existing unit tests, logcat -v printable
Change-Id: I4cc95aee81519411ef47892ca74eb31117c972d2
I'm not sure why I didn't remove this when I got rid of the other
functions marked as weak.
Test: build
Change-Id: I45e6bca7be0497e33be88d15afea8bb1d5165380
The system version of liblog has been versioned. Do the same for
LL-NDK verison as well.
Test: Build and examine the dynamic symbols.
Change-Id: Ie63cc845c891d9372fb1990e713b3fe4f0f2f723
There are a bunch of branches that check "id >= LOG_ID_MAX", but because
C++ hates you, this does a promotion to signed int despite the
fact that both sides of the comparison are the same enum with an
underlying type of unsigned int. (C++17 §7.6.3)
Return LOG_ID_MAX instead of a value that gets promoted to signed -1, to
avoid this.
Bug: http://b/129272512
Test: /data/nativetest64/logcat-unit-tests/logcat-unit-tests
Change-Id: I4b3ee662d76d5cc80d9a9625d17f7e5b5980de41
The code section is already marked as to be removed, simply suppress
the -Wstring-plus-int warning.
Test: m checkbuild
Bug: 128878287
Change-Id: I95a03aca90dbb5d27db49f5baf534cbaacf9b830
Remove a superfluous check in fs_mgr, since those return values are
already impossible for a non-debuggable build. Replace a one time
call to __android_log_is_debuggable(), since there's no reason to
cache the value or use this symbol.
Test: build
Change-Id: Icd4bef7b616c49d304303747388d7e3018c6fcfc
Ensure that only the symbols in liblog.map.txt can be used by the
platform.
Bug: 123349183
Test: build
Change-Id: I99ae5d0e8ba8f5061ec20701c941d861c9eb615d
socket_local_client() was copied from libcutils, but we only need a
small subset of its functionality. We instead create our own version
with just the needed parts.
Importantly, use CLOEXEC in this new function and other places where
it was missing previously.
Test: logging works, liblog-unit-tests
Change-Id: Ifb929227af67bafa13e391eab92358d9f6fe6450
liblog has a version script for the NDK and VNDK, however it doesn't
have symbols intended to be used by the platform. This change adds
those symbols to the version script and enables it, hiding the rest of
the symbols.
Test: build
Change-Id: I494d048d78bb47d763482eb56a6f79babfe163f4
- Zero initialize log_time instances by default
- Disable implicit conversions by making constructors explicit
- Explicitly initialize to EPOCH in most places
- Change sniffTime() to avoid in-place modification of a log_time
I stopped here, but we could consider following up with a more invasive
change to make log_time instances immutable and perhaps also remove the
default constructor to force explicit initialization to EPOCH.
Test: atest libbase_test netd_unit_test
Change-Id: I67e716ef74adaaf40ab2c6e2e0dddb8d309bc7ca
readv() isn't used by anyone, writev() has one easily replaced user.
uio.h can be left as a private header for windows compatibility with
struct iovec.
Test: build
Change-Id: I33d4c6bdee6fd818271f78ae06abdd2aa09430f2
After a few years of being available, there only ended up being one
user of this, so it is clear that logd's duplicate message mechanism
is the favored solution.
The one user of this rate limiting is questionable as is, since due to
the nature of storaged, the mainloop only runs once per minute by
default as is, so there is essentially nothing to be gained by rate
limiting any further.
Test: build
Change-Id: I0610d11efda1ce8b581b939bad11ff295cb2daa6
These headers are platforms headers, so by definition they'll never be
compiled for a platform less than the current one.
Test: build
Change-Id: Ic1c1535b935929d713806faf17fbf9cd82275329
Some liblog tests test symbols that aren't otherwise used on the
platform. Statically link the tests such that we can add version
scripts that expose only the symbols used by the platform, and still
allow the tests to test the rest.
Test: build + unit tests
Change-Id: I898280fa52d31a2c7ad4eafdaa85e8b5f2e87971
No users ever signed up to use this, so remove it to ease the
refactoring of liblog/libbase.
Bug: 119867234
Test: liblog unit tests
Change-Id: I37b99644112bae7b4a2e3f4d06749db08de4ea14