From ff2dcd9af994a23ed483939a416b48bdc10eefd5 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 28 Sep 2016 15:54:45 -0700 Subject: [PATCH] system/core Replace log/log.h with android/log.h Should use android/log.h instead of log/log.h as a good example to all others. Adjust header order to comply with Android Coding standards. Test: Compile Bug: 26552300 Bug: 31289077 Change-Id: I33a8fb4e754d2dc4754d335660c450e0a67190fc --- adb/file_sync_service.cpp | 12 ++++++------ adb/shell_service.cpp | 2 +- base/logging.cpp | 8 ++++---- bootstat/bootstat.cpp | 7 +++++-- bootstat/event_log_list_builder.cpp | 3 ++- bootstat/event_log_list_builder_test.cpp | 5 +++-- bootstat/histogram_logger.cpp | 6 ++++-- debuggerd/arm/machine.cpp | 2 +- debuggerd/arm64/machine.cpp | 2 +- debuggerd/backtrace.cpp | 17 ++++++++--------- debuggerd/crasher.cpp | 2 +- debuggerd/elf_utils.cpp | 4 ++-- debuggerd/mips/machine.cpp | 2 +- debuggerd/mips64/machine.cpp | 2 +- debuggerd/test/log_fake.cpp | 2 +- debuggerd/tombstone.cpp | 14 ++++++-------- debuggerd/utility.cpp | 4 ++-- debuggerd/x86/machine.cpp | 2 +- debuggerd/x86_64/machine.cpp | 2 +- include/log/logprint.h | 7 ++++--- libbacktrace/BacktraceLog.h | 2 +- libbacktrace/BacktraceMap.cpp | 2 +- libcutils/sockets_unix.cpp | 3 +-- libcutils/trace-dev.c | 4 ++-- libdiskconfig/diskconfig.c | 8 +++----- libdiskconfig/diskutils.c | 4 ++-- libmemtrack/memtrack.c | 5 ++--- libmemunreachable/log.h | 2 +- libnativeloader/native_loader.cpp | 10 +++++----- libutils/SharedBuffer.cpp | 2 +- libutils/Unicode.cpp | 6 +++--- libziparchive/zip_archive.cc | 14 +++++++------- libziparchive/zip_archive_stream_entry.cc | 5 +++-- lmkd/lmkd.c | 2 +- trusty/nvram/trusty_nvram_implementation.cpp | 6 +++--- 35 files changed, 91 insertions(+), 89 deletions(-) diff --git a/adb/file_sync_service.cpp b/adb/file_sync_service.cpp index 14c26cb60..2dfad94b7 100644 --- a/adb/file_sync_service.cpp +++ b/adb/file_sync_service.cpp @@ -31,17 +31,17 @@ #include #include +#include +#include +#include +#include +#include + #include "adb.h" #include "adb_io.h" #include "adb_utils.h" -#include "private/android_filesystem_config.h" #include "security_log_tags.h" -#include -#include -#include -#include - 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 b0b31f1b8..7b00d9d76 100644 --- a/adb/shell_service.cpp +++ b/adb/shell_service.cpp @@ -92,10 +92,10 @@ #include #include +#include #include #include #include -#include #include "adb.h" #include "adb_io.h" diff --git a/base/logging.cpp b/base/logging.cpp index eaed9abe1..ece10ecdd 100644 --- a/base/logging.cpp +++ b/base/logging.cpp @@ -43,18 +43,18 @@ #include #include -#include "android-base/macros.h" -#include "android-base/strings.h" - // Headers for LogMessage::LogLine. #ifdef __ANDROID__ +#include #include -#include "log/log.h" #else #include #include #endif +#include +#include + // 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 71a5a3993..0ab4c98d4 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -20,6 +20,7 @@ #include #include + #include #include #include @@ -27,12 +28,14 @@ #include #include #include + +#include #include #include #include -#include + #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 241e3d59e..a6af13e0f 100644 --- a/bootstat/event_log_list_builder.cpp +++ b/bootstat/event_log_list_builder.cpp @@ -19,8 +19,9 @@ #include #include #include + +#include #include -#include namespace { diff --git a/bootstat/event_log_list_builder_test.cpp b/bootstat/event_log_list_builder_test.cpp index affb4bf13..8f7f323f8 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 -#include + +#include #include -#include +#include using testing::ElementsAreArray; diff --git a/bootstat/histogram_logger.cpp b/bootstat/histogram_logger.cpp index e3aad28eb..3144d8b5e 100644 --- a/bootstat/histogram_logger.cpp +++ b/bootstat/histogram_logger.cpp @@ -18,8 +18,10 @@ #include #include + +#include #include -#include + #include "event_log_list_builder.h" namespace bootstat { @@ -38,4 +40,4 @@ void LogHistogram(const std::string& event, int32_t data) { 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 78c230615..292edcba0 100644 --- a/debuggerd/arm/machine.cpp +++ b/debuggerd/arm/machine.cpp @@ -22,8 +22,8 @@ #include #include +#include #include -#include #include "machine.h" #include "utility.h" diff --git a/debuggerd/arm64/machine.cpp b/debuggerd/arm64/machine.cpp index e7bf79a8f..cd1bd528c 100644 --- a/debuggerd/arm64/machine.cpp +++ b/debuggerd/arm64/machine.cpp @@ -24,8 +24,8 @@ #include #include +#include #include -#include #include "machine.h" #include "utility.h" diff --git a/debuggerd/backtrace.cpp b/debuggerd/backtrace.cpp index 8f4a53f57..06c1efeca 100644 --- a/debuggerd/backtrace.cpp +++ b/debuggerd/backtrace.cpp @@ -16,25 +16,24 @@ #define LOG_TAG "DEBUG" +#include +#include +#include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include #include #include +#include #include -#include - #include "backtrace.h" #include "utility.h" diff --git a/debuggerd/crasher.cpp b/debuggerd/crasher.cpp index a37df3350..7d3509c76 100644 --- a/debuggerd/crasher.cpp +++ b/debuggerd/crasher.cpp @@ -13,8 +13,8 @@ #include #include +#include #include -#include #if defined(STATIC_CRASHER) #include "debuggerd/client.h" diff --git a/debuggerd/elf_utils.cpp b/debuggerd/elf_utils.cpp index 3d99cab31..d760a37da 100644 --- a/debuggerd/elf_utils.cpp +++ b/debuggerd/elf_utils.cpp @@ -23,9 +23,9 @@ #include -#include +#include #include -#include +#include #include "elf_utils.h" diff --git a/debuggerd/mips/machine.cpp b/debuggerd/mips/machine.cpp index cbf272a36..99a9d65a5 100644 --- a/debuggerd/mips/machine.cpp +++ b/debuggerd/mips/machine.cpp @@ -22,8 +22,8 @@ #include #include +#include #include -#include #include "machine.h" #include "utility.h" diff --git a/debuggerd/mips64/machine.cpp b/debuggerd/mips64/machine.cpp index 0a8d53257..ecd1ca2c8 100644 --- a/debuggerd/mips64/machine.cpp +++ b/debuggerd/mips64/machine.cpp @@ -22,8 +22,8 @@ #include #include +#include #include -#include #include "machine.h" #include "utility.h" diff --git a/debuggerd/test/log_fake.cpp b/debuggerd/test/log_fake.cpp index e27e9f661..ebf966faa 100644 --- a/debuggerd/test/log_fake.cpp +++ b/debuggerd/test/log_fake.cpp @@ -19,8 +19,8 @@ #include +#include #include -#include #include // Forward declarations. diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp index e66392023..5c7f02423 100644 --- a/debuggerd/tombstone.cpp +++ b/debuggerd/tombstone.cpp @@ -25,23 +25,21 @@ #include #include #include -#include #include #include +#include #include #include -#include - +#include #include -#include -#include -#include -#include - #include #include +#include +#include +#include +#include #include diff --git a/debuggerd/utility.cpp b/debuggerd/utility.cpp index 7fabf690b..e334e715c 100644 --- a/debuggerd/utility.cpp +++ b/debuggerd/utility.cpp @@ -21,15 +21,15 @@ #include #include #include -#include #include #include +#include #include +#include #include #include -#include // 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 af10817a4..a6f21e1fc 100644 --- a/debuggerd/x86/machine.cpp +++ b/debuggerd/x86/machine.cpp @@ -21,8 +21,8 @@ #include #include +#include #include -#include #include "machine.h" #include "utility.h" diff --git a/debuggerd/x86_64/machine.cpp b/debuggerd/x86_64/machine.cpp index fc86bc2b9..705e12df3 100644 --- a/debuggerd/x86_64/machine.cpp +++ b/debuggerd/x86_64/machine.cpp @@ -22,8 +22,8 @@ #include #include +#include #include -#include #include "machine.h" #include "utility.h" diff --git a/include/log/logprint.h b/include/log/logprint.h index 45230cd6a..b8d8d4ccb 100644 --- a/include/log/logprint.h +++ b/include/log/logprint.h @@ -17,11 +17,12 @@ #ifndef _LOGPRINT_H #define _LOGPRINT_H -#include -#include -#include #include +#include +#include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/libbacktrace/BacktraceLog.h b/libbacktrace/BacktraceLog.h index 5c39f1c04..0a2798202 100644 --- a/libbacktrace/BacktraceLog.h +++ b/libbacktrace/BacktraceLog.h @@ -19,7 +19,7 @@ #define LOG_TAG "libbacktrace" -#include +#include // 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 00c35b18d..19ea1e369 100644 --- a/libbacktrace/BacktraceMap.cpp +++ b/libbacktrace/BacktraceMap.cpp @@ -20,9 +20,9 @@ #include #include +#include #include #include -#include #include "thread_utils.h" diff --git a/libcutils/sockets_unix.cpp b/libcutils/sockets_unix.cpp index d4dca633d..e51a1c7a2 100644 --- a/libcutils/sockets_unix.cpp +++ b/libcutils/sockets_unix.cpp @@ -14,11 +14,10 @@ * limitations under the License. */ -#include - #include #include +#include #if defined(__ANDROID__) /* For the socket trust (credentials) check */ diff --git a/libcutils/trace-dev.c b/libcutils/trace-dev.c index b91c7bef3..dcd95821f 100644 --- a/libcutils/trace-dev.c +++ b/libcutils/trace-dev.c @@ -25,12 +25,12 @@ #include #include #include + +#include #include #include #include -#include - /** * 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 1167d4b5e..2d59ad996 100644 --- a/libdiskconfig/diskconfig.c +++ b/libdiskconfig/diskconfig.c @@ -20,21 +20,19 @@ #include #include #include +#include #include #include #include -#include #include #include +#include -#include - +#include #include -#include #include - static int parse_len(const char *str, uint64_t *plen) { diff --git a/libdiskconfig/diskutils.c b/libdiskconfig/diskutils.c index 5d0ee6267..3a2760155 100644 --- a/libdiskconfig/diskutils.c +++ b/libdiskconfig/diskutils.c @@ -23,10 +23,10 @@ #include #include #include -#include #include +#include -#include +#include #include diff --git a/libmemtrack/memtrack.c b/libmemtrack/memtrack.c index b52821438..29cc92c83 100644 --- a/libmemtrack/memtrack.c +++ b/libmemtrack/memtrack.c @@ -14,16 +14,15 @@ * limitations under the License. */ -#include - #define LOG_TAG "memtrack" -#include +#include #include #include #include +#include #include #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) diff --git a/libmemunreachable/log.h b/libmemunreachable/log.h index cdfbfd9d6..dd146b65a 100644 --- a/libmemunreachable/log.h +++ b/libmemunreachable/log.h @@ -19,6 +19,6 @@ #define LOG_TAG "libmemunreachable" -#include +#include #endif // LIBMEMUNREACHABLE_LOG_H_ diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index e89c50f40..3a6e54d82 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -20,9 +20,9 @@ #include #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 @@ -30,9 +30,9 @@ #include #include -#include "android-base/file.h" -#include "android-base/macros.h" -#include "android-base/strings.h" +#include +#include +#include namespace android { diff --git a/libutils/SharedBuffer.cpp b/libutils/SharedBuffer.cpp index 6c8c7d3dc..2b3690c07 100644 --- a/libutils/SharedBuffer.cpp +++ b/libutils/SharedBuffer.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include "SharedBuffer.h" diff --git a/libutils/Unicode.cpp b/libutils/Unicode.cpp index 5f96efa79..065210193 100644 --- a/libutils/Unicode.cpp +++ b/libutils/Unicode.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include -#include - #include #include +#include +#include + #if defined(_WIN32) # undef nhtol # undef htonl diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc index 4649a75b2..cc3f0e4d7 100644 --- a/libziparchive/zip_archive.cc +++ b/libziparchive/zip_archive.cc @@ -30,13 +30,13 @@ #include #include -#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 +#include +#include +#include // TEMP_FAILURE_RETRY may or may not be in unistd +#include +#include +#include #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 4b205a788..41988bcc9 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 #include @@ -24,9 +26,8 @@ #include #include -#define LOG_TAG "ZIPARCHIVE" +#include #include -#include #include #include #include diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c index df1b9afbd..107aa3edc 100644 --- a/lmkd/lmkd.c +++ b/lmkd/lmkd.c @@ -30,8 +30,8 @@ #include #include +#include #include -#include #include #ifndef __unused diff --git a/trusty/nvram/trusty_nvram_implementation.cpp b/trusty/nvram/trusty_nvram_implementation.cpp index 041c1bd3a..caa25abf7 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 #include +#include #include #include -#define LOG_TAG "TrustyNVRAM" -#include - #include namespace nvram {