Replace cutils/log.h and rationalize log/log.h and android/log.h
- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if required
- add system includes that are assumed as side effects of log.h
- modules that use SLOG should use SLOG for all logging (installd)
- define LOG_TAG first
- remove logging infrastructure if not used
Test: build
Bug: 31289077
Change-Id: Iea147a0104c7ab7f12451304131d6500f42141e7
diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp
index 790fa8c..71dba8b 100644
--- a/libs/binder/IMemory.cpp
+++ b/libs/binder/IMemory.cpp
@@ -17,21 +17,20 @@
#define LOG_TAG "IMemory"
#include <atomic>
+#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-
#include <sys/types.h>
#include <sys/mman.h>
+#include <unistd.h>
+#include <android/log.h>
#include <binder/IMemory.h>
-#include <cutils/log.h>
-#include <utils/KeyedVector.h>
-#include <utils/threads.h>
#include <binder/Parcel.h>
#include <utils/CallStack.h>
+#include <utils/KeyedVector.h>
+#include <utils/threads.h>
#define VERBOSE 0
diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp
index 43a01e4..ebb2175 100644
--- a/libs/binder/MemoryHeapBase.cpp
+++ b/libs/binder/MemoryHeapBase.cpp
@@ -16,16 +16,16 @@
#define LOG_TAG "MemoryHeapBase"
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
-#include <cutils/log.h>
+#include <android/log.h>
#include <cutils/ashmem.h>
#include <cutils/atomic.h>
diff --git a/libs/binder/PersistableBundle.cpp b/libs/binder/PersistableBundle.cpp
index e7078ba..70d425e 100644
--- a/libs/binder/PersistableBundle.cpp
+++ b/libs/binder/PersistableBundle.cpp
@@ -20,9 +20,9 @@
#include <limits>
+#include <android/log.h>
#include <binder/IBinder.h>
#include <binder/Parcel.h>
-#include <log/log.h>
#include <utils/Errors.h>
using android::BAD_TYPE;
diff --git a/libs/gui/GraphicBufferAlloc.cpp b/libs/gui/GraphicBufferAlloc.cpp
index e6150f4..3b37e5b 100644
--- a/libs/gui/GraphicBufferAlloc.cpp
+++ b/libs/gui/GraphicBufferAlloc.cpp
@@ -15,7 +15,7 @@
** limitations under the License.
*/
-#include <cutils/log.h>
+#include <android/log.h>
#include <ui/GraphicBuffer.h>
diff --git a/libs/gui/Sensor.cpp b/libs/gui/Sensor.cpp
index 053d153..dbf03a5 100644
--- a/libs/gui/Sensor.cpp
+++ b/libs/gui/Sensor.cpp
@@ -14,21 +14,20 @@
* limitations under the License.
*/
+#include <inttypes.h>
+#include <stdint.h>
+#include <sys/limits.h>
+#include <sys/types.h>
+#include <android/log.h>
#include <binder/AppOpsManager.h>
#include <binder/IServiceManager.h>
#include <gui/Sensor.h>
#include <hardware/sensors.h>
-#include <log/log.h>
#include <utils/Errors.h>
#include <utils/String8.h>
#include <utils/Flattenable.h>
-#include <inttypes.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/limits.h>
-
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
diff --git a/libs/input/InputTransport.cpp b/libs/input/InputTransport.cpp
index 2dff4e0..136dd7f 100644
--- a/libs/input/InputTransport.cpp
+++ b/libs/input/InputTransport.cpp
@@ -19,20 +19,18 @@
// Log debug messages about touch event resampling
#define DEBUG_RESAMPLING 0
-
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <math.h>
-#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <unistd.h>
-#include <cutils/log.h>
+#include <android/log.h>
#include <cutils/properties.h>
#include <input/InputTransport.h>
-
namespace android {
// Socket buffer size. The default is typically about 128KB, which is much larger than
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index edfff4d..9655dd2 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -18,7 +18,7 @@
#define LOG_TAG "GraphicBufferAllocator"
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
-#include <cutils/log.h>
+#include <android/log.h>
#include <utils/Singleton.h>
#include <utils/String8.h>