From e2f889da0b9f2ba3c529abd7d9215614c3029f8b Mon Sep 17 00:00:00 2001 From: Ethan Chen Date: Sat, 19 Oct 2019 23:53:57 -0700 Subject: [PATCH] compat: Add shim for libbase LogMessage functions Change-Id: I4d1db75e5407586c9b69d94803af0ef9a9a91037 --- Android.bp | 7 +++++++ libbase/.clang-format | 1 + libbase/logging.cpp | 12 ++++++++++++ 3 files changed, 20 insertions(+) create mode 120000 libbase/.clang-format create mode 100644 libbase/logging.cpp diff --git a/Android.bp b/Android.bp index deb805c..3efe204 100644 --- a/Android.bp +++ b/Android.bp @@ -226,6 +226,13 @@ cc_defaults { srcs: ["libgui/gui_shim.cpp"], } +cc_library { + name: "libbase_shim", + shared_libs: ["libbase"], + srcs: ["libbase/logging.cpp"], + vendor: true +} + cc_library { name: "libcutils_shim", shared_libs: [ diff --git a/libbase/.clang-format b/libbase/.clang-format new file mode 120000 index 0000000..0457b53 --- /dev/null +++ b/libbase/.clang-format @@ -0,0 +1 @@ +../../../../build/soong/scripts/system-clang-format \ No newline at end of file diff --git a/libbase/logging.cpp b/libbase/logging.cpp new file mode 100644 index 0000000..7e52db0 --- /dev/null +++ b/libbase/logging.cpp @@ -0,0 +1,12 @@ +#include + +extern "C" void _ZN7android4base10LogMessageC1EPKcjNS0_5LogIdENS0_11LogSeverityES3_i( + const char* file, unsigned int line, android::base::LogId id, + android::base::LogSeverity severity, const char* tag, int error); + +extern "C" void _ZN7android4base10LogMessageC1EPKcjNS0_5LogIdENS0_11LogSeverityEi( + const char* file, unsigned int line, android::base::LogId id, + android::base::LogSeverity severity, int error) { + _ZN7android4base10LogMessageC1EPKcjNS0_5LogIdENS0_11LogSeverityES3_i(file, line, id, severity, + nullptr, error); +}