From d88dfe8607af019186a309674d9081a056ed3daa Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Tue, 11 Apr 2017 08:56:09 -0700 Subject: [PATCH] libhardware: deprecate cutils/log.h Replace cutils/log.h with log/log.h. Sort headers. Minimize conflicts. Add missing required headers. Test: compile Bug: 34250038 Change-Id: I5c0f231cbfed90b73e0538c9d32ad3226c7cc5e4 --- include/hardware/audio_alsaops.h | 3 ++- include/hardware/fingerprint.h | 1 + modules/audio/audio_hw.c | 9 ++++++--- modules/audio_remote_submix/audio_hw.cpp | 5 ++--- modules/camera/Camera.cpp | 23 ++++++++++++++--------- modules/camera/CameraHAL.cpp | 14 +++++++------- modules/camera/ExampleCamera.cpp | 11 ++++++----- modules/camera/Metadata.cpp | 6 +++--- modules/camera/Stream.cpp | 17 +++++++++-------- modules/camera/VendorTags.cpp | 12 +++++++----- modules/consumerir/consumerir.c | 8 ++++++-- modules/fingerprint/fingerprint.c | 7 +++++-- modules/gralloc/framebuffer.cpp | 24 ++++++++++-------------- modules/gralloc/gralloc.cpp | 13 ++++++------- modules/gralloc/mapper.cpp | 7 +++---- modules/hwcomposer/hwcomposer.cpp | 5 ++--- modules/local_time/local_time_hw.c | 2 +- modules/nfc-nci/nfc_nci_example.c | 4 ++-- modules/radio/radio_hal_tool.c | 6 ++++-- modules/radio/radio_hw.c | 18 +++++++++++------- modules/sensors/SensorEventQueue.cpp | 8 +++++--- modules/soundtrigger/sound_trigger_hw.c | 17 ++++++++--------- modules/tv_input/tv_input.cpp | 2 +- modules/usbcamera/Camera.cpp | 23 +++++++++++++++-------- modules/usbcamera/CameraHAL.cpp | 8 ++++++-- modules/usbcamera/HotplugThread.cpp | 3 ++- modules/usbcamera/Metadata.cpp | 5 +++-- modules/usbcamera/Stream.cpp | 10 ++++++---- modules/usbcamera/UsbCamera.cpp | 7 +++++-- modules/vehicle/vehicle.c | 2 +- modules/vibrator/vibrator.c | 14 +++++++------- tests/camera2/CameraMetadataTests.cpp | 9 ++++++--- tests/nusensors/nusensors.cpp | 5 +++-- tests/vehicle/vehicle-hal-tool.c | 6 ++++-- 34 files changed, 179 insertions(+), 135 deletions(-) diff --git a/include/hardware/audio_alsaops.h b/include/hardware/audio_alsaops.h index 0d266ff5..f83941e4 100644 --- a/include/hardware/audio_alsaops.h +++ b/include/hardware/audio_alsaops.h @@ -22,7 +22,8 @@ #ifndef ANDROID_AUDIO_ALSAOPS_H #define ANDROID_AUDIO_ALSAOPS_H -#include +#include + #include #include diff --git a/include/hardware/fingerprint.h b/include/hardware/fingerprint.h index 618ca7ea..b4465ba7 100644 --- a/include/hardware/fingerprint.h +++ b/include/hardware/fingerprint.h @@ -17,6 +17,7 @@ #ifndef ANDROID_INCLUDE_HARDWARE_FINGERPRINT_H #define ANDROID_INCLUDE_HARDWARE_FINGERPRINT_H +#include #include #define FINGERPRINT_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) diff --git a/modules/audio/audio_hw.c b/modules/audio/audio_hw.c index 35901e41..3c288cab 100644 --- a/modules/audio/audio_hw.c +++ b/modules/audio/audio_hw.c @@ -21,13 +21,16 @@ #include #include #include -#include +#include +#include +#include +#include -#include +#include +#include #include #include -#include struct stub_audio_device { struct audio_hw_device device; diff --git a/modules/audio_remote_submix/audio_hw.cpp b/modules/audio_remote_submix/audio_hw.cpp index d47cfbaf..6c538cee 100644 --- a/modules/audio_remote_submix/audio_hw.cpp +++ b/modules/audio_remote_submix/audio_hw.cpp @@ -26,9 +26,10 @@ #include #include -#include #include #include +#include +#include #include #include @@ -39,8 +40,6 @@ #include #include -#include - #define LOG_STREAMS_TO_FILES 0 #if LOG_STREAMS_TO_FILES #include diff --git a/modules/camera/Camera.cpp b/modules/camera/Camera.cpp index de3ae788..dc7ffa57 100644 --- a/modules/camera/Camera.cpp +++ b/modules/camera/Camera.cpp @@ -13,25 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "Camera" + +#include +#include +#include +#include #include -#include + +#include +#include + +#define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) +#include + #include #include #include #include -#include #include "CameraHAL.h" #include "Metadata.h" #include "Stream.h" -//#define LOG_NDEBUG 0 -#define LOG_TAG "Camera" -#include - -#define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) -#include - #include "Camera.h" #define CAMERA_SYNC_TIMEOUT 5000 // in msecs diff --git a/modules/camera/CameraHAL.cpp b/modules/camera/CameraHAL.cpp index e395ce5a..2d1d7631 100644 --- a/modules/camera/CameraHAL.cpp +++ b/modules/camera/CameraHAL.cpp @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "DefaultCameraHAL" #include + +#include +#define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) +#include + #include #include #include "ExampleCamera.h" #include "VendorTags.h" -//#define LOG_NDEBUG 0 -#define LOG_TAG "DefaultCameraHAL" -#include - -#define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) -#include - #include "CameraHAL.h" /* diff --git a/modules/camera/ExampleCamera.cpp b/modules/camera/ExampleCamera.cpp index d060d35f..473cb60e 100644 --- a/modules/camera/ExampleCamera.cpp +++ b/modules/camera/ExampleCamera.cpp @@ -13,17 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include -#include "Camera.h" - //#define LOG_NDEBUG 0 #define LOG_TAG "ExampleCamera" -#include + +#include + +#include #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) #include +#include +#include "Camera.h" #include "ExampleCamera.h" #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) diff --git a/modules/camera/Metadata.cpp b/modules/camera/Metadata.cpp index 18e52391..440da5f8 100644 --- a/modules/camera/Metadata.cpp +++ b/modules/camera/Metadata.cpp @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "Metadata" #include -//#define LOG_NDEBUG 0 -#define LOG_TAG "Metadata" -#include +#include #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) #include diff --git a/modules/camera/Stream.cpp b/modules/camera/Stream.cpp index e0099b6e..a38b5903 100644 --- a/modules/camera/Stream.cpp +++ b/modules/camera/Stream.cpp @@ -13,20 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include -#include -#include -#include -#include - //#define LOG_NDEBUG 0 #define LOG_TAG "Stream" -#include + +#include + +#include +#include #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) #include +#include +#include +#include + #include "Stream.h" namespace default_camera_hal { diff --git a/modules/camera/VendorTags.cpp b/modules/camera/VendorTags.cpp index 48c1a46c..9a34dc9f 100644 --- a/modules/camera/VendorTags.cpp +++ b/modules/camera/VendorTags.cpp @@ -13,17 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include -#include "Metadata.h" - //#define LOG_NDEBUG 0 #define LOG_TAG "VendorTags" -#include + +#include + +#include #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) #include +#include +#include "Metadata.h" + #include "VendorTags.h" namespace default_camera_hal { diff --git a/modules/consumerir/consumerir.c b/modules/consumerir/consumerir.c index b0ff9406..f2cc6232 100644 --- a/modules/consumerir/consumerir.c +++ b/modules/consumerir/consumerir.c @@ -17,10 +17,14 @@ #include #include +#include #include -#include -#include +#include + +#include + #include +#include #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) diff --git a/modules/fingerprint/fingerprint.c b/modules/fingerprint/fingerprint.c index 08b112b6..8f4bca66 100644 --- a/modules/fingerprint/fingerprint.c +++ b/modules/fingerprint/fingerprint.c @@ -17,10 +17,13 @@ #include #include +#include #include -#include -#include + +#include + #include +#include static int fingerprint_close(hw_device_t *dev) { diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp index eadcdaa6..7ef8098d 100644 --- a/modules/gralloc/framebuffer.cpp +++ b/modules/gralloc/framebuffer.cpp @@ -14,24 +14,20 @@ * limitations under the License. */ +#include +#include +#include +#include +#include +#include #include -#include - #include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include #include +#include + +#include +#include #ifdef __ANDROID__ #include diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp index e9559e9b..f8d3c78a 100644 --- a/modules/gralloc/gralloc.cpp +++ b/modules/gralloc/gralloc.cpp @@ -14,25 +14,24 @@ * limitations under the License. */ -#include -#include -#include #include +#include +#include #include #include #include - +#include #include #include #include -#include +#include #include -#include #include +#include -#include #include +#include #include "gralloc_priv.h" #include "gr.h" diff --git a/modules/gralloc/mapper.cpp b/modules/gralloc/mapper.cpp index 20d98418..ee3e40e0 100644 --- a/modules/gralloc/mapper.cpp +++ b/modules/gralloc/mapper.cpp @@ -14,18 +14,17 @@ * limitations under the License. */ -#include #include +#include #include -#include #include - #include #include #include +#include -#include #include +#include #include #include diff --git a/modules/hwcomposer/hwcomposer.cpp b/modules/hwcomposer/hwcomposer.cpp index 9d1aa34f..297cafd8 100644 --- a/modules/hwcomposer/hwcomposer.cpp +++ b/modules/hwcomposer/hwcomposer.cpp @@ -14,15 +14,14 @@ * limitations under the License. */ -#include - #include #include #include -#include #include +#include +#include #include #include diff --git a/modules/local_time/local_time_hw.c b/modules/local_time/local_time_hw.c index ac597f4f..4b216561 100644 --- a/modules/local_time/local_time_hw.c +++ b/modules/local_time/local_time_hw.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/modules/nfc-nci/nfc_nci_example.c b/modules/nfc-nci/nfc_nci_example.c index 758c2b74..cdfd7d77 100644 --- a/modules/nfc-nci/nfc_nci_example.c +++ b/modules/nfc-nci/nfc_nci_example.c @@ -17,11 +17,11 @@ #include #include -#include +#include + #include #include - /* * NCI HAL method implementations. These must be overriden */ diff --git a/modules/radio/radio_hal_tool.c b/modules/radio/radio_hal_tool.c index 05d872ed..baa2efe2 100644 --- a/modules/radio/radio_hal_tool.c +++ b/modules/radio/radio_hal_tool.c @@ -16,16 +16,18 @@ #define LOG_TAG "radio_hal_tool" +#include #include #include +#include + +#include -#include #include #include #include #include - // Global state variables. const struct radio_tuner *hal_tuner = NULL; diff --git a/modules/radio/radio_hw.c b/modules/radio/radio_hw.c index 09f07b1e..f1448da0 100644 --- a/modules/radio/radio_hw.c +++ b/modules/radio/radio_hw.c @@ -17,22 +17,26 @@ #define LOG_TAG "radio_hw_stub" #define LOG_NDEBUG 0 -#include -#include #include +#include #include +#include +#include +#include #include +#include #include #include -#include -#include +#include #include -#include + #include -#include -#include +#include + #include #include +#include +#include static const radio_hal_properties_t hw_properties = { .class_id = RADIO_CLASS_AM_FM, diff --git a/modules/sensors/SensorEventQueue.cpp b/modules/sensors/SensorEventQueue.cpp index f6144f88..0d4d64a4 100644 --- a/modules/sensors/SensorEventQueue.cpp +++ b/modules/sensors/SensorEventQueue.cpp @@ -14,11 +14,13 @@ * limitations under the License. */ -#include -#include #include -#include +#include + +#include + +#include #include "SensorEventQueue.h" SensorEventQueue::SensorEventQueue(int capacity) { diff --git a/modules/soundtrigger/sound_trigger_hw.c b/modules/soundtrigger/sound_trigger_hw.c index 20d97f2c..0089f980 100644 --- a/modules/soundtrigger/sound_trigger_hw.c +++ b/modules/soundtrigger/sound_trigger_hw.c @@ -51,21 +51,20 @@ #define ERROR_BAD_COMMAND "Bad command" +#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/modules/tv_input/tv_input.cpp b/modules/tv_input/tv_input.cpp index 114e80ed..f93cb200 100644 --- a/modules/tv_input/tv_input.cpp +++ b/modules/tv_input/tv_input.cpp @@ -18,8 +18,8 @@ #include #include -#include #include +#include #include diff --git a/modules/usbcamera/Camera.cpp b/modules/usbcamera/Camera.cpp index cf62f7f4..500a982b 100644 --- a/modules/usbcamera/Camera.cpp +++ b/modules/usbcamera/Camera.cpp @@ -16,21 +16,28 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "Camera" -#include + +#include +#include +#include +#include #include -#include -#include -#include -#include + +#include #include -#include "CameraHAL.h" -#include "Metadata.h" -#include "Stream.h" #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) #include +#include +#include +#include + +#include "CameraHAL.h" +#include "Metadata.h" +#include "Stream.h" + #include "Camera.h" namespace usb_camera_hal { diff --git a/modules/usbcamera/CameraHAL.cpp b/modules/usbcamera/CameraHAL.cpp index 652e937b..eec10448 100644 --- a/modules/usbcamera/CameraHAL.cpp +++ b/modules/usbcamera/CameraHAL.cpp @@ -16,13 +16,17 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "UsbCameraHAL" -#include #include + +#include +#include + #include #include -#include "UsbCamera.h" + #include "CameraHAL.h" +#include "UsbCamera.h" /* * This file serves as the entry point to the HAL. It contains the module diff --git a/modules/usbcamera/HotplugThread.cpp b/modules/usbcamera/HotplugThread.cpp index 6c650861..80f18c8b 100644 --- a/modules/usbcamera/HotplugThread.cpp +++ b/modules/usbcamera/HotplugThread.cpp @@ -16,7 +16,8 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "HotplugThread" -#include + +#include #include "HotplugThread.h" diff --git a/modules/usbcamera/Metadata.cpp b/modules/usbcamera/Metadata.cpp index f243834f..78318f39 100644 --- a/modules/usbcamera/Metadata.cpp +++ b/modules/usbcamera/Metadata.cpp @@ -16,13 +16,14 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "Metadata" -#include -#include +#include #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) #include +#include + #include "Metadata.h" namespace usb_camera_hal { diff --git a/modules/usbcamera/Stream.cpp b/modules/usbcamera/Stream.cpp index f56866ea..45e7fc28 100644 --- a/modules/usbcamera/Stream.cpp +++ b/modules/usbcamera/Stream.cpp @@ -16,17 +16,19 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "Stream" -#include #include -#include -#include -#include + +#include #include #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) #include +#include +#include +#include + #include "Stream.h" namespace usb_camera_hal { diff --git a/modules/usbcamera/UsbCamera.cpp b/modules/usbcamera/UsbCamera.cpp index d0aadede..ec949aee 100644 --- a/modules/usbcamera/UsbCamera.cpp +++ b/modules/usbcamera/UsbCamera.cpp @@ -16,13 +16,16 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "UsbCameraDevice" -#include -#include +#include + +#include #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) #include +#include + #include "Camera.h" #include "UsbCamera.h" diff --git a/modules/vehicle/vehicle.c b/modules/vehicle/vehicle.c index a26f27c0..78545afc 100644 --- a/modules/vehicle/vehicle.c +++ b/modules/vehicle/vehicle.c @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include diff --git a/modules/vibrator/vibrator.c b/modules/vibrator/vibrator.c index 92c46e24..950bc599 100644 --- a/modules/vibrator/vibrator.c +++ b/modules/vibrator/vibrator.c @@ -14,19 +14,19 @@ * limitations under the License. */ -#include #include +#include -#include - +#include +#include #include -#include +#include #include +#include #include #include -#include -#include -#include + +#include #define TIMEOUT_STR_LEN 20 diff --git a/tests/camera2/CameraMetadataTests.cpp b/tests/camera2/CameraMetadataTests.cpp index da5b7483..16b2dd9c 100644 --- a/tests/camera2/CameraMetadataTests.cpp +++ b/tests/camera2/CameraMetadataTests.cpp @@ -16,8 +16,13 @@ #define LOG_NDEBUG 0 #define LOG_TAG "CameraMetadataTestFunctional" -#include "cutils/log.h" + +#include + +#include + #include "cutils/properties.h" +#include "log/log.h" #include "utils/Errors.h" #include "gtest/gtest.h" @@ -31,8 +36,6 @@ #include #include -#include - #include "CameraStreamFixture.h" #include "TestExtensions.h" diff --git a/tests/nusensors/nusensors.cpp b/tests/nusensors/nusensors.cpp index 55b77850..a063959d 100644 --- a/tests/nusensors/nusensors.cpp +++ b/tests/nusensors/nusensors.cpp @@ -17,14 +17,15 @@ #include #include #include +#include #include #include #include -#include +#include +#include #include -#include char const* getSensorName(int type) { switch(type) { diff --git a/tests/vehicle/vehicle-hal-tool.c b/tests/vehicle/vehicle-hal-tool.c index e85df621..94624d34 100755 --- a/tests/vehicle/vehicle-hal-tool.c +++ b/tests/vehicle/vehicle-hal-tool.c @@ -17,13 +17,15 @@ #define LOG_TAG "vehicle-hal-tool" #include +#include #include #include + +#include + #include #include -#include - void usage() { printf("Usage: " "./vehicle-hal-tool [-l] [-m -p -t [-v]]\n"