From 73ac28b4086f6d9f11433bcaa4fa601d079e9d04 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Tue, 20 Feb 2018 14:45:12 -0800 Subject: [PATCH] Expose __android_log_buf_print and __android_log_buf_write to NDK These are needed to build libbase with the NDK. Bug: 73658597 Test: tree hugger Change-Id: Icf4a82c5c08975731c180be155743ac63f4bfd50 --- liblog/include/android/log.h | 30 ++++++++++++++++++++++++++++++ liblog/liblog.map.txt | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/liblog/include/android/log.h b/liblog/include/android/log.h index ade282187..28c87e46d 100644 --- a/liblog/include/android/log.h +++ b/liblog/include/android/log.h @@ -171,6 +171,36 @@ void __android_log_assert(const char* cond, const char* tag, const char* fmt, #endif ; +#ifndef log_id_t_defined +#define log_id_t_defined +typedef enum log_id { + LOG_ID_MIN = 0, + + LOG_ID_MAIN = 0, + LOG_ID_RADIO = 1, + LOG_ID_EVENTS = 2, + LOG_ID_SYSTEM = 3, + LOG_ID_CRASH = 4, + LOG_ID_STATS = 5, + LOG_ID_SECURITY = 6, + LOG_ID_KERNEL = 7, /* place last, third-parties can not use it */ + + LOG_ID_MAX +} log_id_t; +#endif + +/* + * Send a simple string to the log. + */ +int __android_log_buf_write(int bufID, int prio, const char* tag, + const char* text); +int __android_log_buf_print(int bufID, int prio, const char* tag, + const char* fmt, ...) +#if defined(__GNUC__) + __attribute__((__format__(printf, 4, 5))) +#endif + ; + #ifdef __cplusplus } #endif diff --git a/liblog/liblog.map.txt b/liblog/liblog.map.txt index 9d21e56eb..66670fe28 100644 --- a/liblog/liblog.map.txt +++ b/liblog/liblog.map.txt @@ -3,8 +3,8 @@ LIBLOG { android_name_to_log_id; # vndk android_log_id_to_name; # vndk __android_log_assert; - __android_log_buf_print; # vndk - __android_log_buf_write; # vndk + __android_log_buf_print; + __android_log_buf_write; __android_log_print; __android_log_vprint; __android_log_write;