Merge "SensorEventQueue_test: Fix compiler warnings"
diff --git a/modules/camera/Camera.h b/modules/camera/Camera.h
index 0ceaf25..072de35 100644
--- a/modules/camera/Camera.h
+++ b/modules/camera/Camera.h
@@ -34,7 +34,7 @@
     public:
         // id is used to distinguish cameras. 0 <= id < NUM_CAMERAS.
         // module is a handle to the HAL module, used when the device is opened.
-        Camera(int id);
+        explicit Camera(int id);
         virtual ~Camera();
 
         // Common Camera Device Operations (see <hardware/camera_common.h>)
diff --git a/modules/camera/CameraHAL.h b/modules/camera/CameraHAL.h
index 00c74e5..74a70a6 100644
--- a/modules/camera/CameraHAL.h
+++ b/modules/camera/CameraHAL.h
@@ -29,7 +29,7 @@
 // camera device.
 class CameraHAL {
     public:
-        CameraHAL(int num_cameras);
+        explicit CameraHAL(int num_cameras);
         ~CameraHAL();
 
         // Camera Module Interface (see <hardware/camera_common.h>)
diff --git a/modules/camera/ExampleCamera.h b/modules/camera/ExampleCamera.h
index 45c4a94..44eac76 100644
--- a/modules/camera/ExampleCamera.h
+++ b/modules/camera/ExampleCamera.h
@@ -27,7 +27,7 @@
 // metadata and logic about that device.
 class ExampleCamera : public Camera {
     public:
-        ExampleCamera(int id);
+        explicit ExampleCamera(int id);
         ~ExampleCamera();
 
     private:
diff --git a/modules/gralloc/gr.h b/modules/gralloc/gr.h
index 732b6bc..ac7e967 100644
--- a/modules/gralloc/gr.h
+++ b/modules/gralloc/gr.h
@@ -48,7 +48,7 @@
     class Autolock {
         Locker& locker;
     public:
-        inline Autolock(Locker& locker) : locker(locker) {  locker.lock(); }
+        inline explicit Autolock(Locker& locker) : locker(locker) {  locker.lock(); }
         inline ~Autolock() { locker.unlock(); }
     };
     inline Locker()        { pthread_mutex_init(&mutex, 0); }
diff --git a/modules/sensors/SensorEventQueue.h b/modules/sensors/SensorEventQueue.h
index 11e1f41..9778e93 100644
--- a/modules/sensors/SensorEventQueue.h
+++ b/modules/sensors/SensorEventQueue.h
@@ -38,7 +38,7 @@
     pthread_cond_t mSpaceAvailableCondition;
 
 public:
-    SensorEventQueue(int capacity);
+    explicit SensorEventQueue(int capacity);
     ~SensorEventQueue();
 
     // Returns length of region, between zero and min(capacity, requestedLength). If there is any
diff --git a/modules/tv_input/tv_input.cpp b/modules/tv_input/tv_input.cpp
index 114e80e..ddace28 100644
--- a/modules/tv_input/tv_input.cpp
+++ b/modules/tv_input/tv_input.cpp
@@ -37,18 +37,18 @@
         const char* name, struct hw_device_t** device);
 
 static struct hw_module_methods_t tv_input_module_methods = {
-    open: tv_input_device_open
+    .open = tv_input_device_open
 };
 
 tv_input_module_t HAL_MODULE_INFO_SYM = {
-    common: {
-        tag: HARDWARE_MODULE_TAG,
-        version_major: 0,
-        version_minor: 1,
-        id: TV_INPUT_HARDWARE_MODULE_ID,
-        name: "Sample TV input module",
-        author: "The Android Open Source Project",
-        methods: &tv_input_module_methods,
+    .common = {
+        .tag = HARDWARE_MODULE_TAG,
+        .version_major = 0,
+        .version_minor = 1,
+        .id = TV_INPUT_HARDWARE_MODULE_ID,
+        .name = "Sample TV input module",
+        .author = "The Android Open Source Project",
+        .methods = &tv_input_module_methods,
     }
 };
 
diff --git a/modules/usbcamera/Camera.h b/modules/usbcamera/Camera.h
index 6419c7d..4051345 100644
--- a/modules/usbcamera/Camera.h
+++ b/modules/usbcamera/Camera.h
@@ -38,7 +38,7 @@
     public:
         // id is used to distinguish cameras. 0 <= id < NUM_CAMERAS.
         // module is a handle to the HAL module, used when the device is opened.
-        Camera(int id);
+        explicit Camera(int id);
         virtual ~Camera();
 
         // Common Camera Device Operations (see <hardware/camera_common.h>)
diff --git a/modules/usbcamera/HotplugThread.h b/modules/usbcamera/HotplugThread.h
index a13adb7..625dcb4 100644
--- a/modules/usbcamera/HotplugThread.h
+++ b/modules/usbcamera/HotplugThread.h
@@ -36,7 +36,7 @@
 class HotplugThread : public android::Thread {
 
     public:
-        HotplugThread(CameraHAL *hal);
+        explicit HotplugThread(CameraHAL *hal);
         ~HotplugThread();
 
         // Override below two methods for proper cleanup.
diff --git a/modules/usbcamera/UsbCamera.h b/modules/usbcamera/UsbCamera.h
index fe52ade..57017fe 100644
--- a/modules/usbcamera/UsbCamera.h
+++ b/modules/usbcamera/UsbCamera.h
@@ -28,7 +28,7 @@
  */
 class UsbCamera : public Camera {
     public:
-        UsbCamera(int id);
+        explicit UsbCamera(int id);
         ~UsbCamera();
 
     private:
diff --git a/modules/vehicle/vehicle.c b/modules/vehicle/vehicle.c
index a26f27c..548ceb3 100644
--- a/modules/vehicle/vehicle.c
+++ b/modules/vehicle/vehicle.c
@@ -279,10 +279,10 @@
             ALOGD("Value type: FLOAT\nValue: %f\n", data->value.float_value);
             break;
         case VEHICLE_VALUE_TYPE_INT32:
-            ALOGD("Value type: INT32\nValue: %d\n", data->value.int32_value);
+            ALOGD("Value type: INT32\nValue: %" PRId32 "\n", data->value.int32_value);
             break;
         case VEHICLE_VALUE_TYPE_INT64:
-            ALOGD("Value type: INT64\nValue: %lld\n", data->value.int64_value);
+            ALOGD("Value type: INT64\nValue: %" PRId64 "\n", data->value.int64_value);
             break;
         case VEHICLE_VALUE_TYPE_BOOLEAN:
             ALOGD("Value type: BOOLEAN\nValue: %d\n", data->value.boolean_value);
diff --git a/tests/camera2/CameraModuleFixture.h b/tests/camera2/CameraModuleFixture.h
index 661c693..25513af 100644
--- a/tests/camera2/CameraModuleFixture.h
+++ b/tests/camera2/CameraModuleFixture.h
@@ -35,7 +35,7 @@
 template <bool InfoQuirk = false>
 struct CameraModuleFixture {
 
-    CameraModuleFixture(int CameraID = -1) {
+    explicit CameraModuleFixture(int CameraID = -1) {
         TEST_EXTENSION_FORKING_CONSTRUCTOR;
 
         mCameraID = CameraID;
diff --git a/tests/camera2/CameraStreamFixture.h b/tests/camera2/CameraStreamFixture.h
index bf7fb42..92ff05b 100644
--- a/tests/camera2/CameraStreamFixture.h
+++ b/tests/camera2/CameraStreamFixture.h
@@ -71,7 +71,7 @@
     : public CameraModuleFixture</*InfoQuirk*/true> {
 
 public:
-    CameraStreamFixture(CameraStreamParams p)
+    explicit CameraStreamFixture(CameraStreamParams p)
     : CameraModuleFixture(TestSettings::DeviceId()) {
         TEST_EXTENSION_FORKING_CONSTRUCTOR;
 
diff --git a/tests/camera2/camera2_utils.h b/tests/camera2/camera2_utils.h
index ab1fcfb..a01bae2 100644
--- a/tests/camera2/camera2_utils.h
+++ b/tests/camera2/camera2_utils.h
@@ -166,7 +166,7 @@
  */
 class StreamAdapter: public camera2_stream_ops {
   public:
-    StreamAdapter(sp<IGraphicBufferProducer> consumer);
+    explicit StreamAdapter(sp<IGraphicBufferProducer> consumer);
 
     ~StreamAdapter();
 
diff --git a/tests/input/evdev/TestHelpers.h b/tests/input/evdev/TestHelpers.h
index 461db04..d26adfb 100644
--- a/tests/input/evdev/TestHelpers.h
+++ b/tests/input/evdev/TestHelpers.h
@@ -42,7 +42,7 @@
  */
 class TempFile {
 public:
-    TempFile(const char* path);
+    explicit TempFile(const char* path);
     ~TempFile();
 
     // No copy or assign