From 9ea359fce0e401cd7a95fe1ac4e1c9926e2a6eb5 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Fri, 25 Mar 2016 15:50:46 -0700 Subject: [PATCH] liblog: LIBLOG_ABI_PRIVATE __android_log_is_debuggable() Allow our own libraries to use this privately instead of running the less efficient get_properties and doing the math. Test: compile and boot smoke test Bug: 27566046 Bug: 31456426 Change-Id: I2f677276d27fbcb6af01b600ac1d9891c8938d43 --- include/private/android_logger.h | 2 ++ liblog/fake_log_device.c | 5 +++++ liblog/log_is_loggable.c | 2 +- liblog/logger.h | 1 - 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/private/android_logger.h b/include/private/android_logger.h index 141001cb9..94095d1df 100644 --- a/include/private/android_logger.h +++ b/include/private/android_logger.h @@ -130,6 +130,8 @@ int __android_log_security_bwrite(int32_t tag, const void *payload, size_t len); int __android_log_security_bswrite(int32_t tag, const char *payload); int __android_log_security(); /* Device Owner is present */ +int __android_log_is_debuggable(); + #if defined(__cplusplus) } #endif diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c index 7bd1f83d4..5f7f05b9d 100644 --- a/liblog/fake_log_device.c +++ b/liblog/fake_log_device.c @@ -727,3 +727,8 @@ LIBLOG_ABI_PUBLIC int __android_log_is_loggable_len(int prio, int logLevel = def; return logLevel >= 0 && prio >= logLevel; } + +LIBLOG_ABI_PRIVATE int __android_log_is_debuggable() +{ + return 1; +} diff --git a/liblog/log_is_loggable.c b/liblog/log_is_loggable.c index 4af8507a2..3dfc6a6f7 100644 --- a/liblog/log_is_loggable.c +++ b/liblog/log_is_loggable.c @@ -274,7 +274,7 @@ LIBLOG_ABI_PUBLIC int __android_log_is_loggable(int prio, return logLevel >= 0 && prio >= logLevel; } -LIBLOG_HIDDEN int __android_log_is_debuggable() +LIBLOG_ABI_PRIVATE int __android_log_is_debuggable() { static uint32_t serial; static struct cache tag_cache; diff --git a/liblog/logger.h b/liblog/logger.h index 8fb2b4d47..bacb24304 100644 --- a/liblog/logger.h +++ b/liblog/logger.h @@ -155,7 +155,6 @@ static inline uid_t __android_log_uid() { return getuid(); } LIBLOG_HIDDEN void __android_log_lock(); LIBLOG_HIDDEN int __android_log_trylock(); LIBLOG_HIDDEN void __android_log_unlock(); -LIBLOG_HIDDEN int __android_log_is_debuggable(); __END_DECLS