Merge "Be stricter about warnings"
diff --git a/include/hardware/audio.h b/include/hardware/audio.h
index 3b734f7..b49dce6 100644
--- a/include/hardware/audio.h
+++ b/include/hardware/audio.h
@@ -682,7 +682,7 @@
                                        struct audio_hw_device** device)
 {
     return module->methods->open(module, AUDIO_HARDWARE_INTERFACE,
-                                 (struct hw_device_t**)device);
+                                 TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int audio_hw_device_close(struct audio_hw_device* device)
diff --git a/include/hardware/camera2.h b/include/hardware/camera2.h
index 2b7add0..547a1d7 100644
--- a/include/hardware/camera2.h
+++ b/include/hardware/camera2.h
@@ -146,7 +146,7 @@
 typedef struct camera2_jpeg_blob {
     uint16_t jpeg_blob_id;
     uint32_t jpeg_size;
-};
+} camera2_jpeg_blob_t;
 
 enum {
     CAMERA2_JPEG_BLOB_ID = 0x00FF
diff --git a/include/hardware/fb.h b/include/hardware/fb.h
index 9df9416..65720a3 100644
--- a/include/hardware/fb.h
+++ b/include/hardware/fb.h
@@ -160,7 +160,7 @@
 static inline int framebuffer_open(const struct hw_module_t* module,
         struct framebuffer_device_t** device) {
     return module->methods->open(module,
-            GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device);
+            GRALLOC_HARDWARE_FB0, TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int framebuffer_close(struct framebuffer_device_t* device) {
diff --git a/include/hardware/gralloc.h b/include/hardware/gralloc.h
index 779915c..1b06ebf 100644
--- a/include/hardware/gralloc.h
+++ b/include/hardware/gralloc.h
@@ -68,69 +68,69 @@
 
 enum {
     /* buffer is never read in software */
-    GRALLOC_USAGE_SW_READ_NEVER         = 0x00000000,
+    GRALLOC_USAGE_SW_READ_NEVER         = 0x00000000U,
     /* buffer is rarely read in software */
-    GRALLOC_USAGE_SW_READ_RARELY        = 0x00000002,
+    GRALLOC_USAGE_SW_READ_RARELY        = 0x00000002U,
     /* buffer is often read in software */
-    GRALLOC_USAGE_SW_READ_OFTEN         = 0x00000003,
+    GRALLOC_USAGE_SW_READ_OFTEN         = 0x00000003U,
     /* mask for the software read values */
-    GRALLOC_USAGE_SW_READ_MASK          = 0x0000000F,
+    GRALLOC_USAGE_SW_READ_MASK          = 0x0000000FU,
 
     /* buffer is never written in software */
-    GRALLOC_USAGE_SW_WRITE_NEVER        = 0x00000000,
+    GRALLOC_USAGE_SW_WRITE_NEVER        = 0x00000000U,
     /* buffer is rarely written in software */
-    GRALLOC_USAGE_SW_WRITE_RARELY       = 0x00000020,
+    GRALLOC_USAGE_SW_WRITE_RARELY       = 0x00000020U,
     /* buffer is often written in software */
-    GRALLOC_USAGE_SW_WRITE_OFTEN        = 0x00000030,
+    GRALLOC_USAGE_SW_WRITE_OFTEN        = 0x00000030U,
     /* mask for the software write values */
-    GRALLOC_USAGE_SW_WRITE_MASK         = 0x000000F0,
+    GRALLOC_USAGE_SW_WRITE_MASK         = 0x000000F0U,
 
     /* buffer will be used as an OpenGL ES texture */
-    GRALLOC_USAGE_HW_TEXTURE            = 0x00000100,
+    GRALLOC_USAGE_HW_TEXTURE            = 0x00000100U,
     /* buffer will be used as an OpenGL ES render target */
-    GRALLOC_USAGE_HW_RENDER             = 0x00000200,
+    GRALLOC_USAGE_HW_RENDER             = 0x00000200U,
     /* buffer will be used by the 2D hardware blitter */
-    GRALLOC_USAGE_HW_2D                 = 0x00000400,
+    GRALLOC_USAGE_HW_2D                 = 0x00000400U,
     /* buffer will be used by the HWComposer HAL module */
-    GRALLOC_USAGE_HW_COMPOSER           = 0x00000800,
+    GRALLOC_USAGE_HW_COMPOSER           = 0x00000800U,
     /* buffer will be used with the framebuffer device */
-    GRALLOC_USAGE_HW_FB                 = 0x00001000,
+    GRALLOC_USAGE_HW_FB                 = 0x00001000U,
 
     /* buffer should be displayed full-screen on an external display when
      * possible */
-    GRALLOC_USAGE_EXTERNAL_DISP         = 0x00002000,
+    GRALLOC_USAGE_EXTERNAL_DISP         = 0x00002000U,
 
     /* Must have a hardware-protected path to external display sink for
      * this buffer.  If a hardware-protected path is not available, then
      * either don't composite only this buffer (preferred) to the
      * external sink, or (less desirable) do not route the entire
      * composition to the external sink.  */
-    GRALLOC_USAGE_PROTECTED             = 0x00004000,
+    GRALLOC_USAGE_PROTECTED             = 0x00004000U,
 
     /* buffer may be used as a cursor */
-    GRALLOC_USAGE_CURSOR                = 0x00008000,
+    GRALLOC_USAGE_CURSOR                = 0x00008000U,
 
     /* buffer will be used with the HW video encoder */
-    GRALLOC_USAGE_HW_VIDEO_ENCODER      = 0x00010000,
+    GRALLOC_USAGE_HW_VIDEO_ENCODER      = 0x00010000U,
     /* buffer will be written by the HW camera pipeline */
-    GRALLOC_USAGE_HW_CAMERA_WRITE       = 0x00020000,
+    GRALLOC_USAGE_HW_CAMERA_WRITE       = 0x00020000U,
     /* buffer will be read by the HW camera pipeline */
-    GRALLOC_USAGE_HW_CAMERA_READ        = 0x00040000,
+    GRALLOC_USAGE_HW_CAMERA_READ        = 0x00040000U,
     /* buffer will be used as part of zero-shutter-lag queue */
-    GRALLOC_USAGE_HW_CAMERA_ZSL         = 0x00060000,
+    GRALLOC_USAGE_HW_CAMERA_ZSL         = 0x00060000U,
     /* mask for the camera access values */
-    GRALLOC_USAGE_HW_CAMERA_MASK        = 0x00060000,
+    GRALLOC_USAGE_HW_CAMERA_MASK        = 0x00060000U,
     /* mask for the software usage bit-mask */
-    GRALLOC_USAGE_HW_MASK               = 0x00071F00,
+    GRALLOC_USAGE_HW_MASK               = 0x00071F00U,
 
     /* buffer will be used as a RenderScript Allocation */
-    GRALLOC_USAGE_RENDERSCRIPT          = 0x00100000,
+    GRALLOC_USAGE_RENDERSCRIPT          = 0x00100000U,
 
     /* Set by the consumer to indicate to the producer that they may attach a
      * buffer that they did not detach from the BufferQueue. Will be filtered
      * out by GRALLOC_USAGE_ALLOC_MASK, so gralloc modules will not need to
      * handle this flag. */
-    GRALLOC_USAGE_FOREIGN_BUFFERS       = 0x00200000,
+    GRALLOC_USAGE_FOREIGN_BUFFERS       = 0x00200000U,
 
     /* Mask of all flags which could be passed to a gralloc module for buffer
      * allocation. Any flags not in this mask do not need to be handled by
@@ -138,11 +138,11 @@
     GRALLOC_USAGE_ALLOC_MASK            = ~(GRALLOC_USAGE_FOREIGN_BUFFERS),
 
     /* implementation-specific private usage flags */
-    GRALLOC_USAGE_PRIVATE_0             = 0x10000000,
-    GRALLOC_USAGE_PRIVATE_1             = 0x20000000,
-    GRALLOC_USAGE_PRIVATE_2             = 0x40000000,
-    GRALLOC_USAGE_PRIVATE_3             = 0x80000000,
-    GRALLOC_USAGE_PRIVATE_MASK          = 0xF0000000,
+    GRALLOC_USAGE_PRIVATE_0             = 0x10000000U,
+    GRALLOC_USAGE_PRIVATE_1             = 0x20000000U,
+    GRALLOC_USAGE_PRIVATE_2             = 0x40000000U,
+    GRALLOC_USAGE_PRIVATE_3             = 0x80000000U,
+    GRALLOC_USAGE_PRIVATE_MASK          = 0xF0000000U,
 };
 
 /*****************************************************************************/
@@ -372,7 +372,7 @@
 static inline int gralloc_open(const struct hw_module_t* module, 
         struct alloc_device_t** device) {
     return module->methods->open(module, 
-            GRALLOC_HARDWARE_GPU0, (struct hw_device_t**)device);
+            GRALLOC_HARDWARE_GPU0, TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int gralloc_close(struct alloc_device_t* device) {
diff --git a/include/hardware/gralloc1.h b/include/hardware/gralloc1.h
index 58c0e33..a1a2d69 100644
--- a/include/hardware/gralloc1.h
+++ b/include/hardware/gralloc1.h
@@ -290,7 +290,7 @@
 static inline int gralloc1_open(const struct hw_module_t* module,
         gralloc1_device_t** device) {
     return module->methods->open(module, GRALLOC_HARDWARE_MODULE_ID,
-            (struct hw_device_t**) device);
+            TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int gralloc1_close(gralloc1_device_t* device) {
diff --git a/include/hardware/hardware.h b/include/hardware/hardware.h
index 74f57aa..bf076f6 100644
--- a/include/hardware/hardware.h
+++ b/include/hardware/hardware.h
@@ -201,6 +201,12 @@
 
 } hw_device_t;
 
+#ifdef __cplusplus
+#define TO_HW_DEVICE_T_OPEN(x) reinterpret_cast<struct hw_device_t**>(x)
+#else
+#define TO_HW_DEVICE_T_OPEN(x) (struct hw_device_t**)(x)
+#endif
+
 /**
  * Name of the hal_module_info
  */
diff --git a/include/hardware/hdmi_cec.h b/include/hardware/hdmi_cec.h
index ab70f92..aa06384 100644
--- a/include/hardware/hdmi_cec.h
+++ b/include/hardware/hdmi_cec.h
@@ -417,7 +417,7 @@
 static inline int hdmi_cec_open(const struct hw_module_t* module,
         struct hdmi_cec_device** device) {
     return module->methods->open(module,
-            HDMI_CEC_HARDWARE_INTERFACE, (struct hw_device_t**)device);
+            HDMI_CEC_HARDWARE_INTERFACE, TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int hdmi_cec_close(struct hdmi_cec_device* device) {
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index 61218bb..7eca7c1 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -783,7 +783,7 @@
 static inline int hwc_open_1(const struct hw_module_t* module,
         hwc_composer_device_1_t** device) {
     return module->methods->open(module,
-            HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device);
+            HWC_HARDWARE_COMPOSER, TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int hwc_close_1(hwc_composer_device_1_t* device) {
diff --git a/include/hardware/hwcomposer2.h b/include/hardware/hwcomposer2.h
index 6973603..35eedb0 100644
--- a/include/hardware/hwcomposer2.h
+++ b/include/hardware/hwcomposer2.h
@@ -17,6 +17,8 @@
 #ifndef ANDROID_HARDWARE_HWCOMPOSER2_H
 #define ANDROID_HARDWARE_HWCOMPOSER2_H
 
+#include <sys/cdefs.h>
+
 #include <hardware/hardware.h>
 
 #include "hwcomposer_defs.h"
@@ -360,7 +362,7 @@
 
 static inline const char* getDisplayRequestName(
         hwc2_display_request_t request) {
-    switch (request) {
+    switch (__BIONIC_CAST(static_cast, int, request)) {
         case 0: return "None";
         case HWC2_DISPLAY_REQUEST_FLIP_CLIENT_TARGET: return "FlipClientTarget";
         case HWC2_DISPLAY_REQUEST_WRITE_CLIENT_TARGET_TO_OUTPUT:
@@ -459,7 +461,7 @@
 }
 
 static inline const char* getLayerRequestName(hwc2_layer_request_t request) {
-    switch (request) {
+    switch (__BIONIC_CAST(static_cast, int, request)) {
         case 0: return "None";
         case HWC2_LAYER_REQUEST_CLEAR_CLIENT_TARGET: return "ClearClientTarget";
         default: return "Unknown";
@@ -477,7 +479,7 @@
 }
 
 static inline const char* getTransformName(hwc_transform_t transform) {
-    switch (transform) {
+    switch (__BIONIC_CAST(static_cast, int, transform)) {
         case 0: return "None";
         case HWC_TRANSFORM_FLIP_H: return "FlipH";
         case HWC_TRANSFORM_FLIP_V: return "FlipV";
@@ -738,7 +740,7 @@
 static inline int hwc2_open(const struct hw_module_t* module,
         hwc2_device_t** device) {
     return module->methods->open(module, HWC_HARDWARE_COMPOSER,
-            (struct hw_device_t**) device);
+            TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int hwc2_close(hwc2_device_t* device) {
diff --git a/include/hardware/keymaster0.h b/include/hardware/keymaster0.h
index f020e5b..52ac64b 100644
--- a/include/hardware/keymaster0.h
+++ b/include/hardware/keymaster0.h
@@ -134,7 +134,7 @@
         keymaster0_device_t** device)
 {
     int rc = module->methods->open(module, KEYSTORE_KEYMASTER,
-            (struct hw_device_t**) device);
+            TO_HW_DEVICE_T_OPEN(device));
 
     return rc;
 }
diff --git a/include/hardware/keymaster1.h b/include/hardware/keymaster1.h
index afd202c..9969380 100644
--- a/include/hardware/keymaster1.h
+++ b/include/hardware/keymaster1.h
@@ -536,7 +536,7 @@
 /* Convenience API for opening and closing keymaster devices */
 
 static inline int keymaster1_open(const struct hw_module_t* module, keymaster1_device_t** device) {
-    return module->methods->open(module, KEYSTORE_KEYMASTER, (struct hw_device_t**)device);
+    return module->methods->open(module, KEYSTORE_KEYMASTER, TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int keymaster1_close(keymaster1_device_t* device) {
diff --git a/include/hardware/keymaster2.h b/include/hardware/keymaster2.h
index 565ad2e..f1993f8 100644
--- a/include/hardware/keymaster2.h
+++ b/include/hardware/keymaster2.h
@@ -420,7 +420,7 @@
 /* Convenience API for opening and closing keymaster devices */
 
 static inline int keymaster2_open(const struct hw_module_t* module, keymaster2_device_t** device) {
-    return module->methods->open(module, KEYSTORE_KEYMASTER, (struct hw_device_t**)device);
+    return module->methods->open(module, KEYSTORE_KEYMASTER, TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int keymaster2_close(keymaster2_device_t* device) {
diff --git a/include/hardware/local_time_hal.h b/include/hardware/local_time_hal.h
index 946e799..1bbbf11 100644
--- a/include/hardware/local_time_hal.h
+++ b/include/hardware/local_time_hal.h
@@ -109,7 +109,7 @@
         struct local_time_hw_device** device)
 {
     return module->methods->open(module, LOCAL_TIME_HARDWARE_INTERFACE,
-                                 (struct hw_device_t**)device);
+                                 TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int local_time_hw_device_close(struct local_time_hw_device* device)
diff --git a/include/hardware/nvram.h b/include/hardware/nvram.h
index 859ea47..0654afe 100644
--- a/include/hardware/nvram.h
+++ b/include/hardware/nvram.h
@@ -326,7 +326,7 @@
 static inline int nvram_open(const struct hw_module_t* module,
                              nvram_device_t** device) {
     return module->methods->open(module, NVRAM_HARDWARE_DEVICE_ID,
-                                 (struct hw_device_t**)device);
+                                 TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int nvram_close(nvram_device_t* device) {
diff --git a/include/hardware/radio.h b/include/hardware/radio.h
index 145deb5..413f413 100644
--- a/include/hardware/radio.h
+++ b/include/hardware/radio.h
@@ -285,7 +285,7 @@
                                        struct radio_hw_device** device)
 {
     return module->methods->open(module, RADIO_HARDWARE_DEVICE,
-                                 (struct hw_device_t**)device);
+                                 TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int radio_hw_device_close(const struct radio_hw_device* device)
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index 99c1147..d98c623 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -1152,7 +1152,7 @@
 
     /**
      * Enumerate all available sensors. The list is returned in "list".
-     * @return number of sensors in the list
+     * return number of sensors in the list
      */
     int (*get_sensors_list)(struct sensors_module_t* module,
             struct sensor_t const** list);
@@ -1163,7 +1163,7 @@
      *  0 - Normal operation. Default state of the module.
      *  1 - Loopback mode. Data is injected for the supported
      *      sensors by the sensor service in this mode.
-     * @return 0 on success
+     * return 0 on success
      *         -EINVAL if requested mode is not supported
      *         -EPERM if operation is not allowed
      */
@@ -1379,7 +1379,7 @@
     /*
      * Inject a single sensor sample to be to this device.
      * data points to the sensor event to be injected
-     * @return 0 on success
+     * return 0 on success
      *         -EPERM if operation is not allowed
      *         -EINVAL if sensor event cannot be injected
      */
@@ -1395,7 +1395,7 @@
 static inline int sensors_open(const struct hw_module_t* module,
         struct sensors_poll_device_t** device) {
     return module->methods->open(module,
-            SENSORS_HARDWARE_POLL, (struct hw_device_t**)device);
+            SENSORS_HARDWARE_POLL, TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int sensors_close(struct sensors_poll_device_t* device) {
@@ -1405,7 +1405,7 @@
 static inline int sensors_open_1(const struct hw_module_t* module,
         sensors_poll_device_1_t** device) {
     return module->methods->open(module,
-            SENSORS_HARDWARE_POLL, (struct hw_device_t**)device);
+            SENSORS_HARDWARE_POLL, TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int sensors_close_1(sensors_poll_device_1_t* device) {
diff --git a/include/hardware/sound_trigger.h b/include/hardware/sound_trigger.h
index e1abbc9..d7828ac 100644
--- a/include/hardware/sound_trigger.h
+++ b/include/hardware/sound_trigger.h
@@ -124,7 +124,7 @@
                                        struct sound_trigger_hw_device** device)
 {
     return module->methods->open(module, SOUND_TRIGGER_HARDWARE_INTERFACE,
-                                 (struct hw_device_t**)device);
+                                 TO_HW_DEVICE_T_OPEN(device));
 }
 
 static inline int sound_trigger_hw_device_close(struct sound_trigger_hw_device* device)
diff --git a/include/hardware/vehicle.h b/include/hardware/vehicle.h
index da11407..35ad493 100644
--- a/include/hardware/vehicle.h
+++ b/include/hardware/vehicle.h
@@ -262,7 +262,6 @@
  * @access VEHICLE_PROP_ACCESS_READ_WRITE
  * @data_member hvac.fan_speed
  * @zone_type VEHICLE_ZONE
- * @data_enum TODO
  * @allow_out_of_range_value : OFF
  */
 #define VEHICLE_PROPERTY_HVAC_FAN_SPEED                             (0x00000500)
@@ -274,7 +273,7 @@
  * @access VEHICLE_PROP_ACCESS_READ_WRITE
  * @data_member hvac.fan_direction
  * @zone_type VEHICLE_ZONE
- * @data_enum TODO
+ * @data_enum vehicle_hvac_fan_direction
  * @allow_out_of_range_value : OFF
  */
 #define VEHICLE_PROPERTY_HVAC_FAN_DIRECTION                         (0x00000501)
@@ -394,13 +393,67 @@
  *
  * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
  * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_WRITE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
  * @zone_type VEHICLE_SEAT
  * @data_member int32_value
  */
 #define VEHICLE_PROPERTY_HVAC_SEAT_TEMPERATURE                      (0x0000050B)
 
 /**
+ * Side Mirror Heat
+ *
+ * Increase values denote higher heating levels for side mirrors.
+ * 0 indicates heating is turned off.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_HVAC_SIDE_MIRROR_HEAT                      (0x0000050C)
+
+/**
+ * Steering Wheel Temperature
+ *
+ * Sets the temperature for the steering wheel
+ * Positive value indicates heating.
+ * Negative value indicates cooling.
+ * 0 indicates tempreature control is off.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_HVAC_STEERING_WHEEL_TEMP                   (0x0000050D)
+
+/**
+ * Temperature units
+ *
+ * Indicates whether the temperature is in Celsius, Fahrenheit, or a different unit.
+ * This parameter affects all HVAC temperatures in the system.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ
+ * @data_enum vehicle_unit_type
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_HVAC_TEMPERATURE_UNITS                     (0x0000050E)
+
+/**
+ * Actual fan speed
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ
+ * @data_member hvac.fan_speed
+ * @zone_type VEHICLE_ZONE
+ * @allow_out_of_range_value : OFF
+ */
+#define VEHICLE_PROPERTY_HVAC_ACTUAL_FAN_SPEED_RPM                  (0x0000050F)
+
+
+/**
  * Represents power state for HVAC. Some HVAC properties will require matching power to be turned on
  * to get out of OFF state. For non-zoned HVAC properties, VEHICLE_ALL_ZONE corresponds to
  * global power state.
@@ -417,6 +470,25 @@
 #define VEHICLE_PROPERTY_HVAC_POWER_ON                              (0x00000510)
 
 /**
+ * Fan Positions Available
+ *
+ * This is a bit mask of fan positions available for the zone.  Each entry in
+ * vehicle_hvac_fan_direction is selected by bit position.  For instance, if
+ * only the FAN_DIRECTION_FACE (0x1) and FAN_DIRECTION_DEFROST (0x4) are available,
+ * then this value shall be set to 0x12.
+ *
+ * 0x12 = (1 << 1) | (1 << 4)
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
+ * @access VEHICLE_PROP_ACCESS_READ
+ * @data_member int32_value
+ * @zone_type VEHICLE_ZONE
+ * @allow_out_of_range_value : OFF
+ */
+#define VEHICLE_PROPERTY_HVAC_FAN_DIRECTION_AVAILABLE               (0x00000511)
+
+/**
  * Outside temperature
  * @value_type VEHICLE_VALUE_TYPE_FLOAT
  * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
@@ -461,7 +533,7 @@
  * @config_flags Number of presets supported
  * @data_member int32_array
  */
-#define VEHICLE_PROPERTY_RADIO_PRESET                                (0x0000801)
+#define VEHICLE_PROPERTY_RADIO_PRESET                               (0x00000801)
 
 /**
  * Constants relevant to radio.
@@ -1313,18 +1385,6 @@
 #define VEHICLE_PROPERTY_MIRROR_LOCK                                (0x00000B44)
 
 /**
- * Mirror Heat
- *
- * Increase values denote higher heating levels.
- *
- * @value_type VEHICLE_VALUE_TYPE_INT32
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_READ_WRITE
- * @data_member int32_value
- */
-#define VEHICLE_PROPERTY_MIRROR_HEAT                                (0x00000B45)
-
-/**
  * Mirror Fold
  *
  * True indicates mirrors are folded
@@ -1334,7 +1394,7 @@
  * @access VEHICLE_PROP_ACCESS_READ_WRITE
  * @data_member boolean_value
  */
-#define VEHICLE_PROPERTY_MIRROR_FOLD                                (0x00000B46)
+#define VEHICLE_PROPERTY_MIRROR_FOLD                                (0x00000B45)
 
 // Seats
 /**
@@ -1653,7 +1713,7 @@
 #define VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_POS                   (0x00000B95)
 
 /**
- * Headrest heigh move
+ * Headrest height move
  *
  * Moves the headrest up and down.
  *
@@ -1694,6 +1754,11 @@
 #define VEHICLE_PROPERTY_SEAT_HEADREST_ANGLE_MOVE                   (0x00000B98)
 
 /**
+ * Headrest fore/aft position
+ *
+ * Adjusts the headrest forwards and backwards.
+ * Max value indicates position closest to front of car.
+ * Min value indicates position closest to rear of car.
  *
  * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
  * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
@@ -1704,6 +1769,7 @@
 #define VEHICLE_PROPERTY_SEAT_HEADREST_FORE_AFT_POS                 (0x00000B99)
 
 /**
+ * Headrest fore/aft move
  *
  * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
  * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
@@ -1854,7 +1920,9 @@
     VEHICLE_UNIT_TYPE_METER                 = 0x00000021,
     VEHICLE_UNIT_TYPE_KILOMETER             = 0x00000023,
     // temperature
-    VEHICLE_UNIT_TYPE_CELCIUS               = 0x00000030,
+    VEHICLE_UNIT_TYPE_CELSIUS               = 0x00000030,
+    VEHICLE_UNIT_TYPE_FAHRENHEIT            = 0x00000031,
+    VEHICLE_UNIT_TYPE_KELVIN                = 0x00000032,
     // volume
     VEHICLE_UNIT_TYPE_MILLILITER            = 0x00000040,
     // time
@@ -2022,17 +2090,15 @@
  * Various Seats in the car.
  */
 enum vehicle_seat {
-    VEHICLE_SEAT_DRIVER_LHD             = 0x0001,
-    VEHICLE_SEAT_DRIVER_RHD             = 0x0002,
-    VEHICLE_SEAT_ROW_1_PASSENGER_LEFT   = 0x0010,
-    VEHICLE_SEAT_ROW_1_PASSENGER_CENTER = 0x0020,
-    VEHICLE_SEAT_ROW_1_PASSENGER_RIGHT  = 0x0040,
-    VEHICLE_SEAT_ROW_2_PASSENGER_LEFT   = 0x0100,
-    VEHICLE_SEAT_ROW_2_PASSENGER_CENTER = 0x0200,
-    VEHICLE_SEAT_ROW_2_PASSENGER_RIGHT  = 0x0400,
-    VEHICLE_SEAT_ROW_3_PASSENGER_LEFT   = 0x1000,
-    VEHICLE_SEAT_ROW_3_PASSENGER_CENTER = 0x2000,
-    VEHICLE_SEAT_ROW_3_PASSENGER_RIGHT  = 0x4000
+    VEHICLE_SEAT_ROW_1_LEFT   = 0x0001,
+    VEHICLE_SEAT_ROW_1_CENTER = 0x0002,
+    VEHICLE_SEAT_ROW_1_RIGHT  = 0x0004,
+    VEHICLE_SEAT_ROW_2_LEFT   = 0x0010,
+    VEHICLE_SEAT_ROW_2_CENTER = 0x0020,
+    VEHICLE_SEAT_ROW_2_RIGHT  = 0x0040,
+    VEHICLE_SEAT_ROW_3_LEFT   = 0x0100,
+    VEHICLE_SEAT_ROW_3_CENTER = 0x0200,
+    VEHICLE_SEAT_ROW_3_RIGHT  = 0x0400
 };
 
 /**
diff --git a/include/hardware/vibrator.h b/include/hardware/vibrator.h
index 200adf0..361085f 100644
--- a/include/hardware/vibrator.h
+++ b/include/hardware/vibrator.h
@@ -65,7 +65,7 @@
 
 static inline int vibrator_open(const struct hw_module_t* module, vibrator_device_t** device)
 {
-    return module->methods->open(module, VIBRATOR_DEVICE_ID_MAIN, (struct hw_device_t**)device);
+    return module->methods->open(module, VIBRATOR_DEVICE_ID_MAIN, TO_HW_DEVICE_T_OPEN(device));
 }
 
 __END_DECLS