system/core Replace log/log.h with android/log.h am: ff2dcd9af9 am: cac331afd9 am: 0308b0eabd
am: 9f6b98dec0
Change-Id: I1a1384253e4fce0489b7d1aa77b0f67ee12185c3
diff --git a/adb/file_sync_service.cpp b/adb/file_sync_service.cpp
index 14c26cb..2dfad94 100644
--- a/adb/file_sync_service.cpp
+++ b/adb/file_sync_service.cpp
@@ -31,17 +31,17 @@
#include <unistd.h>
#include <utime.h>
+#include <android/log.h>
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
+#include <private/android_filesystem_config.h>
+#include <selinux/android.h>
+
#include "adb.h"
#include "adb_io.h"
#include "adb_utils.h"
-#include "private/android_filesystem_config.h"
#include "security_log_tags.h"
-#include <android-base/stringprintf.h>
-#include <android-base/strings.h>
-#include <log/log.h>
-#include <selinux/android.h>
-
static bool should_use_fs_config(const std::string& path) {
// TODO: use fs_config to configure permissions on /data.
return android::base::StartsWith(path, "/system/") ||
diff --git a/adb/shell_service.cpp b/adb/shell_service.cpp
index b0b31f1..7b00d9d 100644
--- a/adb/shell_service.cpp
+++ b/adb/shell_service.cpp
@@ -92,10 +92,10 @@
#include <unordered_map>
#include <vector>
+#include <android/log.h>
#include <android-base/logging.h>
#include <android-base/stringprintf.h>
#include <paths.h>
-#include <log/log.h>
#include "adb.h"
#include "adb_io.h"
diff --git a/base/logging.cpp b/base/logging.cpp
index eaed9ab..ece10ec 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -43,18 +43,18 @@
#include <utility>
#include <vector>
-#include "android-base/macros.h"
-#include "android-base/strings.h"
-
// Headers for LogMessage::LogLine.
#ifdef __ANDROID__
+#include <android/log.h>
#include <android/set_abort_message.h>
-#include "log/log.h"
#else
#include <sys/types.h>
#include <unistd.h>
#endif
+#include <android-base/macros.h>
+#include <android-base/strings.h>
+
// For gettid.
#if defined(__APPLE__)
#include "AvailabilityMacros.h" // For MAC_OS_X_VERSION_MAX_ALLOWED
diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp
index 71a5a39..0ab4c98 100644
--- a/bootstat/bootstat.cpp
+++ b/bootstat/bootstat.cpp
@@ -20,6 +20,7 @@
#include <getopt.h>
#include <unistd.h>
+
#include <cmath>
#include <cstddef>
#include <cstdio>
@@ -27,12 +28,14 @@
#include <map>
#include <memory>
#include <string>
+
+#include <android/log.h>
#include <android-base/logging.h>
#include <android-base/parseint.h>
#include <cutils/properties.h>
-#include <log/log.h>
+
#include "boot_event_record_store.h"
-#include "event_log_list_builder.h"
+#include "event_log_list_builder.h" /* ToDo: switch to liblog implementation */
#include "histogram_logger.h"
#include "uptime_parser.h"
diff --git a/bootstat/event_log_list_builder.cpp b/bootstat/event_log_list_builder.cpp
index 241e3d5..a6af13e 100644
--- a/bootstat/event_log_list_builder.cpp
+++ b/bootstat/event_log_list_builder.cpp
@@ -19,8 +19,9 @@
#include <cinttypes>
#include <memory>
#include <string>
+
+#include <android/log.h>
#include <android-base/logging.h>
-#include <log/log.h>
namespace {
diff --git a/bootstat/event_log_list_builder_test.cpp b/bootstat/event_log_list_builder_test.cpp
index affb4bf..8f7f323 100644
--- a/bootstat/event_log_list_builder_test.cpp
+++ b/bootstat/event_log_list_builder_test.cpp
@@ -17,9 +17,10 @@
#include "event_log_list_builder.h"
#include <inttypes.h>
-#include <gtest/gtest.h>
+
+#include <android/log.h>
#include <gmock/gmock.h>
-#include <log/log.h>
+#include <gtest/gtest.h>
using testing::ElementsAreArray;
diff --git a/bootstat/histogram_logger.cpp b/bootstat/histogram_logger.cpp
index e3aad28..3144d8b 100644
--- a/bootstat/histogram_logger.cpp
+++ b/bootstat/histogram_logger.cpp
@@ -18,8 +18,10 @@
#include <cstdlib>
#include <memory>
+
+#include <android/log.h>
#include <android-base/logging.h>
-#include <log/log.h>
+
#include "event_log_list_builder.h"
namespace bootstat {
@@ -38,4 +40,4 @@
android_bWriteLog(HISTOGRAM_LOG_TAG, log.get(), size);
}
-} // namespace bootstat
\ No newline at end of file
+} // namespace bootstat
diff --git a/debuggerd/arm/machine.cpp b/debuggerd/arm/machine.cpp
index 78c2306..292edcb 100644
--- a/debuggerd/arm/machine.cpp
+++ b/debuggerd/arm/machine.cpp
@@ -22,8 +22,8 @@
#include <string.h>
#include <sys/ptrace.h>
+#include <android/log.h>
#include <backtrace/Backtrace.h>
-#include <log/log.h>
#include "machine.h"
#include "utility.h"
diff --git a/debuggerd/arm64/machine.cpp b/debuggerd/arm64/machine.cpp
index e7bf79a..cd1bd52 100644
--- a/debuggerd/arm64/machine.cpp
+++ b/debuggerd/arm64/machine.cpp
@@ -24,8 +24,8 @@
#include <sys/ptrace.h>
#include <sys/uio.h>
+#include <android/log.h>
#include <backtrace/Backtrace.h>
-#include <log/log.h>
#include "machine.h"
#include "utility.h"
diff --git a/debuggerd/backtrace.cpp b/debuggerd/backtrace.cpp
index 8f4a53f..06c1efe 100644
--- a/debuggerd/backtrace.cpp
+++ b/debuggerd/backtrace.cpp
@@ -16,25 +16,24 @@
#define LOG_TAG "DEBUG"
+#include <errno.h>
+#include <dirent.h>
+#include <limits.h>
#include <stddef.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <errno.h>
-#include <limits.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <sys/types.h>
#include <sys/ptrace.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
#include <memory>
#include <string>
+#include <android/log.h>
#include <backtrace/Backtrace.h>
-#include <log/log.h>
-
#include "backtrace.h"
#include "utility.h"
diff --git a/debuggerd/crasher.cpp b/debuggerd/crasher.cpp
index a37df33..7d3509c 100644
--- a/debuggerd/crasher.cpp
+++ b/debuggerd/crasher.cpp
@@ -13,8 +13,8 @@
#include <sys/wait.h>
#include <unistd.h>
+#include <android/log.h>
#include <cutils/sockets.h>
-#include <log/log.h>
#if defined(STATIC_CRASHER)
#include "debuggerd/client.h"
diff --git a/debuggerd/elf_utils.cpp b/debuggerd/elf_utils.cpp
index 3d99cab..d760a37 100644
--- a/debuggerd/elf_utils.cpp
+++ b/debuggerd/elf_utils.cpp
@@ -23,9 +23,9 @@
#include <string>
-#include <backtrace/Backtrace.h>
+#include <android/log.h>
#include <android-base/stringprintf.h>
-#include <log/log.h>
+#include <backtrace/Backtrace.h>
#include "elf_utils.h"
diff --git a/debuggerd/mips/machine.cpp b/debuggerd/mips/machine.cpp
index cbf272a..99a9d65 100644
--- a/debuggerd/mips/machine.cpp
+++ b/debuggerd/mips/machine.cpp
@@ -22,8 +22,8 @@
#include <string.h>
#include <sys/ptrace.h>
+#include <android/log.h>
#include <backtrace/Backtrace.h>
-#include <log/log.h>
#include "machine.h"
#include "utility.h"
diff --git a/debuggerd/mips64/machine.cpp b/debuggerd/mips64/machine.cpp
index 0a8d532..ecd1ca2 100644
--- a/debuggerd/mips64/machine.cpp
+++ b/debuggerd/mips64/machine.cpp
@@ -22,8 +22,8 @@
#include <string.h>
#include <sys/ptrace.h>
+#include <android/log.h>
#include <backtrace/Backtrace.h>
-#include <log/log.h>
#include "machine.h"
#include "utility.h"
diff --git a/debuggerd/test/log_fake.cpp b/debuggerd/test/log_fake.cpp
index e27e9f6..ebf966f 100644
--- a/debuggerd/test/log_fake.cpp
+++ b/debuggerd/test/log_fake.cpp
@@ -19,8 +19,8 @@
#include <string>
+#include <android/log.h>
#include <android-base/stringprintf.h>
-#include <log/log.h>
#include <log/logger.h>
// Forward declarations.
diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp
index e663920..5c7f024 100644
--- a/debuggerd/tombstone.cpp
+++ b/debuggerd/tombstone.cpp
@@ -25,23 +25,21 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <sys/ptrace.h>
#include <sys/stat.h>
+#include <time.h>
#include <memory>
#include <string>
-#include <private/android_filesystem_config.h>
-
+#include <android/log.h>
#include <android-base/stringprintf.h>
-#include <cutils/properties.h>
-#include <log/log.h>
-#include <log/logger.h>
-#include <log/logprint.h>
-
#include <backtrace/Backtrace.h>
#include <backtrace/BacktraceMap.h>
+#include <cutils/properties.h>
+#include <log/logger.h>
+#include <log/logprint.h>
+#include <private/android_filesystem_config.h>
#include <selinux/android.h>
diff --git a/debuggerd/utility.cpp b/debuggerd/utility.cpp
index 7fabf69..e334e71 100644
--- a/debuggerd/utility.cpp
+++ b/debuggerd/utility.cpp
@@ -21,15 +21,15 @@
#include <errno.h>
#include <signal.h>
#include <string.h>
-#include <unistd.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
+#include <unistd.h>
#include <string>
+#include <android/log.h>
#include <android-base/stringprintf.h>
#include <backtrace/Backtrace.h>
-#include <log/log.h>
// Whitelist output desired in the logcat output.
bool is_allowed_in_logcat(enum logtype ltype) {
diff --git a/debuggerd/x86/machine.cpp b/debuggerd/x86/machine.cpp
index af10817..a6f21e1 100644
--- a/debuggerd/x86/machine.cpp
+++ b/debuggerd/x86/machine.cpp
@@ -21,8 +21,8 @@
#include <string.h>
#include <sys/ptrace.h>
+#include <android/log.h>
#include <backtrace/Backtrace.h>
-#include <log/log.h>
#include "machine.h"
#include "utility.h"
diff --git a/debuggerd/x86_64/machine.cpp b/debuggerd/x86_64/machine.cpp
index fc86bc2..705e12d 100644
--- a/debuggerd/x86_64/machine.cpp
+++ b/debuggerd/x86_64/machine.cpp
@@ -22,8 +22,8 @@
#include <string.h>
#include <sys/user.h>
+#include <android/log.h>
#include <backtrace/Backtrace.h>
-#include <log/log.h>
#include "machine.h"
#include "utility.h"
diff --git a/include/log/logprint.h b/include/log/logprint.h
index 45230cd..b8d8d4c 100644
--- a/include/log/logprint.h
+++ b/include/log/logprint.h
@@ -17,11 +17,12 @@
#ifndef _LOGPRINT_H
#define _LOGPRINT_H
-#include <android/log.h>
-#include <log/logger.h>
-#include <log/event_tag_map.h>
#include <pthread.h>
+#include <android/log.h>
+#include <log/event_tag_map.h>
+#include <log/logger.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/libbacktrace/BacktraceLog.h b/libbacktrace/BacktraceLog.h
index 5c39f1c..0a27982 100644
--- a/libbacktrace/BacktraceLog.h
+++ b/libbacktrace/BacktraceLog.h
@@ -19,7 +19,7 @@
#define LOG_TAG "libbacktrace"
-#include <log/log.h>
+#include <android/log.h>
// Macro to log the function name along with the warning message.
#define BACK_LOGW(format, ...) \
diff --git a/libbacktrace/BacktraceMap.cpp b/libbacktrace/BacktraceMap.cpp
index 00c35b1..19ea1e3 100644
--- a/libbacktrace/BacktraceMap.cpp
+++ b/libbacktrace/BacktraceMap.cpp
@@ -20,9 +20,9 @@
#include <sys/types.h>
#include <unistd.h>
+#include <android/log.h>
#include <backtrace/backtrace_constants.h>
#include <backtrace/BacktraceMap.h>
-#include <log/log.h>
#include "thread_utils.h"
diff --git a/libcutils/sockets_unix.cpp b/libcutils/sockets_unix.cpp
index d4dca63..e51a1c7 100644
--- a/libcutils/sockets_unix.cpp
+++ b/libcutils/sockets_unix.cpp
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-#include <cutils/sockets.h>
-
#include <sys/uio.h>
#include <android/log.h>
+#include <cutils/sockets.h>
#if defined(__ANDROID__)
/* For the socket trust (credentials) check */
diff --git a/libcutils/trace-dev.c b/libcutils/trace-dev.c
index b91c7be..dcd9582 100644
--- a/libcutils/trace-dev.c
+++ b/libcutils/trace-dev.c
@@ -25,12 +25,12 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+
+#include <android/log.h>
#include <cutils/compiler.h>
#include <cutils/properties.h>
#include <cutils/trace.h>
-#include <android/log.h>
-
/**
* Maximum size of a message that can be logged to the trace buffer.
* Note this message includes a tag, the pid, and the string given as the name.
diff --git a/libdiskconfig/diskconfig.c b/libdiskconfig/diskconfig.c
index 1167d4b..2d59ad9 100644
--- a/libdiskconfig/diskconfig.c
+++ b/libdiskconfig/diskconfig.c
@@ -20,21 +20,19 @@
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
+#include <linux/fs.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <unistd.h>
-#include <linux/fs.h>
-
+#include <android/log.h>
#include <cutils/config_utils.h>
-#include <log/log.h>
#include <diskconfig/diskconfig.h>
-
static int
parse_len(const char *str, uint64_t *plen)
{
diff --git a/libdiskconfig/diskutils.c b/libdiskconfig/diskutils.c
index 5d0ee62..3a27601 100644
--- a/libdiskconfig/diskutils.c
+++ b/libdiskconfig/diskutils.c
@@ -23,10 +23,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <sys/stat.h>
+#include <unistd.h>
-#include <log/log.h>
+#include <android/log.h>
#include <diskconfig/diskconfig.h>
diff --git a/libmemtrack/memtrack.c b/libmemtrack/memtrack.c
index b528214..29cc92c 100644
--- a/libmemtrack/memtrack.c
+++ b/libmemtrack/memtrack.c
@@ -14,16 +14,15 @@
* limitations under the License.
*/
-#include <memtrack/memtrack.h>
-
#define LOG_TAG "memtrack"
-#include <log/log.h>
+#include <memtrack/memtrack.h>
#include <errno.h>
#include <malloc.h>
#include <string.h>
+#include <android/log.h>
#include <hardware/memtrack.h>
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
diff --git a/libmemunreachable/log.h b/libmemunreachable/log.h
index cdfbfd9..dd146b6 100644
--- a/libmemunreachable/log.h
+++ b/libmemunreachable/log.h
@@ -19,6 +19,6 @@
#define LOG_TAG "libmemunreachable"
-#include <log/log.h>
+#include <android/log.h>
#endif // LIBMEMUNREACHABLE_LOG_H_
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index e89c50f..3a6e54d 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -20,9 +20,9 @@
#include <dlfcn.h>
#ifdef __ANDROID__
#include "dlext_namespaces.h"
-#include "cutils/properties.h"
#define LOG_TAG "libnativeloader"
-#include "log/log.h"
+#include "android/log.h"
+#include "cutils/properties.h"
#endif
#include <algorithm>
@@ -30,9 +30,9 @@
#include <string>
#include <mutex>
-#include "android-base/file.h"
-#include "android-base/macros.h"
-#include "android-base/strings.h"
+#include <android-base/file.h>
+#include <android-base/macros.h>
+#include <android-base/strings.h>
namespace android {
diff --git a/libutils/SharedBuffer.cpp b/libutils/SharedBuffer.cpp
index d4fb3f9..1aa761a 100644
--- a/libutils/SharedBuffer.cpp
+++ b/libutils/SharedBuffer.cpp
@@ -17,7 +17,7 @@
#include <stdlib.h>
#include <string.h>
-#include <log/log.h>
+#include <android/log.h>
#include "SharedBuffer.h"
diff --git a/libutils/Unicode.cpp b/libutils/Unicode.cpp
index 5f96efa..0652101 100644
--- a/libutils/Unicode.cpp
+++ b/libutils/Unicode.cpp
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-#include <log/log.h>
-#include <utils/Unicode.h>
-
#include <limits.h>
#include <stddef.h>
+#include <android/log.h>
+#include <utils/Unicode.h>
+
#if defined(_WIN32)
# undef nhtol
# undef htonl
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc
index 45f6f0f..a1455b0 100644
--- a/libziparchive/zip_archive.cc
+++ b/libziparchive/zip_archive.cc
@@ -30,13 +30,13 @@
#include <memory>
#include <vector>
-#include "android-base/file.h"
-#include "android-base/logging.h"
-#include "android-base/macros.h" // TEMP_FAILURE_RETRY may or may not be in unistd
-#include "android-base/memory.h"
-#include "log/log.h"
-#include "utils/Compat.h"
-#include "utils/FileMap.h"
+#include <android/log.h>
+#include <android-base/file.h>
+#include <android-base/logging.h>
+#include <android-base/macros.h> // TEMP_FAILURE_RETRY may or may not be in unistd
+#include <android-base/memory.h>
+#include <utils/Compat.h>
+#include <utils/FileMap.h>
#include "ziparchive/zip_archive.h"
#include "zlib.h"
diff --git a/libziparchive/zip_archive_stream_entry.cc b/libziparchive/zip_archive_stream_entry.cc
index 4b205a7..41988bc 100644
--- a/libziparchive/zip_archive_stream_entry.cc
+++ b/libziparchive/zip_archive_stream_entry.cc
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "ZIPARCHIVE"
+
// Read-only stream access to Zip Archive entries.
#include <errno.h>
#include <inttypes.h>
@@ -24,9 +26,8 @@
#include <memory>
#include <vector>
-#define LOG_TAG "ZIPARCHIVE"
+#include <android/log.h>
#include <android-base/file.h>
-#include <log/log.h>
#include <ziparchive/zip_archive.h>
#include <ziparchive/zip_archive_stream_entry.h>
#include <zlib.h>
diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c
index df1b9af..107aa3e 100644
--- a/lmkd/lmkd.c
+++ b/lmkd/lmkd.c
@@ -30,8 +30,8 @@
#include <sys/types.h>
#include <unistd.h>
+#include <android/log.h>
#include <cutils/sockets.h>
-#include <log/log.h>
#include <processgroup/processgroup.h>
#ifndef __unused
diff --git a/trusty/nvram/trusty_nvram_implementation.cpp b/trusty/nvram/trusty_nvram_implementation.cpp
index 041c1bd..caa25ab 100644
--- a/trusty/nvram/trusty_nvram_implementation.cpp
+++ b/trusty/nvram/trusty_nvram_implementation.cpp
@@ -14,17 +14,17 @@
* limitations under the License.
*/
+#define LOG_TAG "TrustyNVRAM"
+
#include "trusty_nvram_implementation.h"
#include <errno.h>
#include <string.h>
+#include <android/log.h>
#include <hardware/nvram.h>
#include <trusty/tipc.h>
-#define LOG_TAG "TrustyNVRAM"
-#include <log/log.h>
-
#include <nvram/messages/blob.h>
namespace nvram {