Merge "fix a memory leak." am: a24fcc412f am: da95482f52 am: e936ee515c
am: 22698fc181

Change-Id: I823d8c25c51e98b05cdb53349e34dc135ea4bde2
diff --git a/include/hardware/audio.h b/include/hardware/audio.h
index c95ad09..813cade 100644
--- a/include/hardware/audio.h
+++ b/include/hardware/audio.h
@@ -22,6 +22,7 @@
 #include <strings.h>
 #include <sys/cdefs.h>
 #include <sys/types.h>
+#include <time.h>
 
 #include <cutils/bitops.h>
 
@@ -59,19 +60,6 @@
 /* Minimal audio HAL version supported by the audio framework */
 #define AUDIO_DEVICE_API_VERSION_MIN AUDIO_DEVICE_API_VERSION_2_0
 
-/**
- * List of known audio HAL modules. This is the base name of the audio HAL
- * library composed of the "audio." prefix, one of the base names below and
- * a suffix specific to the device.
- * e.g: audio.primary.goldfish.so or audio.a2dp.default.so
- */
-
-#define AUDIO_HARDWARE_MODULE_ID_PRIMARY "primary"
-#define AUDIO_HARDWARE_MODULE_ID_A2DP "a2dp"
-#define AUDIO_HARDWARE_MODULE_ID_USB "usb"
-#define AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX "r_submix"
-#define AUDIO_HARDWARE_MODULE_ID_CODEC_OFFLOAD "codec_offload"
-
 /**************************************/
 
 /**
@@ -82,11 +70,6 @@
  *  audio device parameters
  */
 
-/* BT SCO Noise Reduction + Echo Cancellation parameters */
-#define AUDIO_PARAMETER_KEY_BT_NREC "bt_headset_nrec"
-#define AUDIO_PARAMETER_VALUE_ON "on"
-#define AUDIO_PARAMETER_VALUE_OFF "off"
-
 /* TTY mode selection */
 #define AUDIO_PARAMETER_KEY_TTY_MODE "tty_mode"
 #define AUDIO_PARAMETER_VALUE_TTY_OFF "tty_off"
@@ -94,8 +77,7 @@
 #define AUDIO_PARAMETER_VALUE_TTY_HCO "tty_hco"
 #define AUDIO_PARAMETER_VALUE_TTY_FULL "tty_full"
 
-/* Hearing Aid Compatibility - Telecoil (HAC-T) mode on/off
-   Strings must be in sync with CallFeaturesSetting.java */
+/* Hearing Aid Compatibility - Telecoil (HAC-T) mode on/off */
 #define AUDIO_PARAMETER_KEY_HAC "HACSetting"
 #define AUDIO_PARAMETER_VALUE_HAC_ON "ON"
 #define AUDIO_PARAMETER_VALUE_HAC_OFF "OFF"
@@ -106,63 +88,15 @@
 /* A2DP source address set by framework */
 #define AUDIO_PARAMETER_A2DP_SOURCE_ADDRESS "a2dp_source_address"
 
-/* Screen state */
-#define AUDIO_PARAMETER_KEY_SCREEN_STATE "screen_state"
-
 /* Bluetooth SCO wideband */
 #define AUDIO_PARAMETER_KEY_BT_SCO_WB "bt_wbs"
 
-/* Get a new HW synchronization source identifier.
- * Return a valid source (positive integer) or AUDIO_HW_SYNC_INVALID if an error occurs
- * or no HW sync is available. */
-#define AUDIO_PARAMETER_HW_AV_SYNC "hw_av_sync"
-
 /**
  *  audio stream parameters
  */
 
-#define AUDIO_PARAMETER_STREAM_ROUTING "routing"             /* audio_devices_t */
-#define AUDIO_PARAMETER_STREAM_FORMAT "format"               /* audio_format_t */
-#define AUDIO_PARAMETER_STREAM_CHANNELS "channels"           /* audio_channel_mask_t */
-#define AUDIO_PARAMETER_STREAM_FRAME_COUNT "frame_count"     /* size_t */
-#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE "input_source"   /* audio_source_t */
-#define AUDIO_PARAMETER_STREAM_SAMPLING_RATE "sampling_rate" /* uint32_t */
-
-#define AUDIO_PARAMETER_DEVICE_CONNECT "connect"            /* audio_devices_t */
-#define AUDIO_PARAMETER_DEVICE_DISCONNECT "disconnect"      /* audio_devices_t */
-
-/* Query supported formats. The response is a '|' separated list of strings from
- * audio_format_t enum e.g: "sup_formats=AUDIO_FORMAT_PCM_16_BIT" */
-#define AUDIO_PARAMETER_STREAM_SUP_FORMATS "sup_formats"
-/* Query supported channel masks. The response is a '|' separated list of strings from
- * audio_channel_mask_t enum e.g: "sup_channels=AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO" */
-#define AUDIO_PARAMETER_STREAM_SUP_CHANNELS "sup_channels"
-/* Query supported sampling rates. The response is a '|' separated list of integer values e.g:
- * "sup_sampling_rates=44100|48000" */
-#define AUDIO_PARAMETER_STREAM_SUP_SAMPLING_RATES "sup_sampling_rates"
-
-/* Set the HW synchronization source for an output stream. */
-#define AUDIO_PARAMETER_STREAM_HW_AV_SYNC "hw_av_sync"
-
-/* Enable mono audio playback if 1, else should be 0. */
-#define AUDIO_PARAMETER_MONO_OUTPUT "mono_output"
-
-/**
- * audio codec parameters
- */
-
-#define AUDIO_OFFLOAD_CODEC_PARAMS "music_offload_codec_param"
-#define AUDIO_OFFLOAD_CODEC_BIT_PER_SAMPLE "music_offload_bit_per_sample"
-#define AUDIO_OFFLOAD_CODEC_BIT_RATE "music_offload_bit_rate"
-#define AUDIO_OFFLOAD_CODEC_AVG_BIT_RATE "music_offload_avg_bit_rate"
-#define AUDIO_OFFLOAD_CODEC_ID "music_offload_codec_id"
-#define AUDIO_OFFLOAD_CODEC_BLOCK_ALIGN "music_offload_block_align"
-#define AUDIO_OFFLOAD_CODEC_SAMPLE_RATE "music_offload_sample_rate"
-#define AUDIO_OFFLOAD_CODEC_ENCODE_OPTION "music_offload_encode_option"
-#define AUDIO_OFFLOAD_CODEC_NUM_CHANNEL  "music_offload_num_channels"
-#define AUDIO_OFFLOAD_CODEC_DOWN_SAMPLING  "music_offload_down_sampling"
-#define AUDIO_OFFLOAD_CODEC_DELAY_SAMPLES  "delay_samples"
-#define AUDIO_OFFLOAD_CODEC_PADDING_SAMPLES  "padding_samples"
+/* Enable AANC */
+#define AUDIO_PARAMETER_KEY_AANC "aanc_enabled"
 
 /**************************************/
 
diff --git a/include/hardware/audio_effect.h b/include/hardware/audio_effect.h
index e49980d..3366e17 100644
--- a/include/hardware/audio_effect.h
+++ b/include/hardware/audio_effect.h
@@ -26,7 +26,7 @@
 
 #include <cutils/bitops.h>
 
-#include <system/audio.h>
+#include <system/audio_effect.h>
 
 
 __BEGIN_DECLS
@@ -36,231 +36,11 @@
 //      Common Definitions
 /////////////////////////////////////////////////
 
-//
-//--- Effect descriptor structure effect_descriptor_t
-//
-
-// Unique effect ID (can be generated from the following site:
-//  http://www.itu.int/ITU-T/asn1/uuid.html)
-// This format is used for both "type" and "uuid" fields of the effect descriptor structure.
-// - When used for effect type and the engine is implementing and effect corresponding to a standard
-// OpenSL ES interface, this ID must be the one defined in OpenSLES_IID.h for that interface.
-// - When used as uuid, it should be a unique UUID for this particular implementation.
-typedef struct effect_uuid_s {
-    uint32_t timeLow;
-    uint16_t timeMid;
-    uint16_t timeHiAndVersion;
-    uint16_t clockSeq;
-    uint8_t node[6];
-} effect_uuid_t;
-
-// Maximum length of character strings in structures defines by this API.
-#define EFFECT_STRING_LEN_MAX 64
-
-// NULL UUID definition (matches SL_IID_NULL_)
-#define EFFECT_UUID_INITIALIZER { 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, \
-                                  { 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } }
-static const effect_uuid_t EFFECT_UUID_NULL_ = EFFECT_UUID_INITIALIZER;
-static const effect_uuid_t * const EFFECT_UUID_NULL = &EFFECT_UUID_NULL_;
-static const char * const EFFECT_UUID_NULL_STR = "ec7178ec-e5e1-4432-a3f4-4657e6795210";
-
-
-// The effect descriptor contains necessary information to facilitate the enumeration of the effect
-// engines present in a library.
-typedef struct effect_descriptor_s {
-    effect_uuid_t type;     // UUID of to the OpenSL ES interface implemented by this effect
-    effect_uuid_t uuid;     // UUID for this particular implementation
-    uint32_t apiVersion;    // Version of the effect control API implemented
-    uint32_t flags;         // effect engine capabilities/requirements flags (see below)
-    uint16_t cpuLoad;       // CPU load indication (see below)
-    uint16_t memoryUsage;   // Data Memory usage (see below)
-    char    name[EFFECT_STRING_LEN_MAX];   // human readable effect name
-    char    implementor[EFFECT_STRING_LEN_MAX];    // human readable effect implementor name
-} effect_descriptor_t;
-
-// CPU load and memory usage indication: each effect implementation must provide an indication of
-// its CPU and memory usage for the audio effect framework to limit the number of effects
-// instantiated at a given time on a given platform.
-// The CPU load is expressed in 0.1 MIPS units as estimated on an ARM9E core (ARMv5TE) with 0 WS.
-// The memory usage is expressed in KB and includes only dynamically allocated memory
-
-// Definitions for flags field of effect descriptor.
-//  +---------------------------+-----------+-----------------------------------
-//  | description               | bits      | values
-//  +---------------------------+-----------+-----------------------------------
-//  | connection mode           | 0..2      | 0 insert: after track process
-//  |                           |           | 1 auxiliary: connect to track auxiliary
-//  |                           |           |  output and use send level
-//  |                           |           | 2 replace: replaces track process function;
-//  |                           |           |   must implement SRC, volume and mono to stereo.
-//  |                           |           | 3 pre processing: applied below audio HAL on input
-//  |                           |           | 4 post processing: applied below audio HAL on output
-//  |                           |           | 5 - 7 reserved
-//  +---------------------------+-----------+-----------------------------------
-//  | insertion preference      | 3..5      | 0 none
-//  |                           |           | 1 first of the chain
-//  |                           |           | 2 last of the chain
-//  |                           |           | 3 exclusive (only effect in the insert chain)
-//  |                           |           | 4..7 reserved
-//  +---------------------------+-----------+-----------------------------------
-//  | Volume management         | 6..8      | 0 none
-//  |                           |           | 1 implements volume control
-//  |                           |           | 2 requires volume indication
-//  |                           |           | 4 reserved
-//  +---------------------------+-----------+-----------------------------------
-//  | Device indication         | 9..11     | 0 none
-//  |                           |           | 1 requires device updates
-//  |                           |           | 2, 4 reserved
-//  +---------------------------+-----------+-----------------------------------
-//  | Sample input mode         | 12..13    | 1 direct: process() function or EFFECT_CMD_SET_CONFIG
-//  |                           |           |   command must specify a buffer descriptor
-//  |                           |           | 2 provider: process() function uses the
-//  |                           |           |   bufferProvider indicated by the
-//  |                           |           |   EFFECT_CMD_SET_CONFIG command to request input.
-//  |                           |           |   buffers.
-//  |                           |           | 3 both: both input modes are supported
-//  +---------------------------+-----------+-----------------------------------
-//  | Sample output mode        | 14..15    | 1 direct: process() function or EFFECT_CMD_SET_CONFIG
-//  |                           |           |   command must specify a buffer descriptor
-//  |                           |           | 2 provider: process() function uses the
-//  |                           |           |   bufferProvider indicated by the
-//  |                           |           |   EFFECT_CMD_SET_CONFIG command to request output
-//  |                           |           |   buffers.
-//  |                           |           | 3 both: both output modes are supported
-//  +---------------------------+-----------+-----------------------------------
-//  | Hardware acceleration     | 16..17    | 0 No hardware acceleration
-//  |                           |           | 1 non tunneled hw acceleration: the process() function
-//  |                           |           |   reads the samples, send them to HW accelerated
-//  |                           |           |   effect processor, reads back the processed samples
-//  |                           |           |   and returns them to the output buffer.
-//  |                           |           | 2 tunneled hw acceleration: the process() function is
-//  |                           |           |   transparent. The effect interface is only used to
-//  |                           |           |   control the effect engine. This mode is relevant for
-//  |                           |           |   global effects actually applied by the audio
-//  |                           |           |   hardware on the output stream.
-//  +---------------------------+-----------+-----------------------------------
-//  | Audio Mode indication     | 18..19    | 0 none
-//  |                           |           | 1 requires audio mode updates
-//  |                           |           | 2..3 reserved
-//  +---------------------------+-----------+-----------------------------------
-//  | Audio source indication   | 20..21    | 0 none
-//  |                           |           | 1 requires audio source updates
-//  |                           |           | 2..3 reserved
-//  +---------------------------+-----------+-----------------------------------
-//  | Effect offload supported  | 22        | 0 The effect cannot be offloaded to an audio DSP
-//  |                           |           | 1 The effect can be offloaded to an audio DSP
-//  +---------------------------+-----------+-----------------------------------
-//  | Process function not      | 23        | 0 The effect implements a process function.
-//  | implemented               |           | 1 The effect does not implement a process function:
-//  |                           |           |   enabling the effect has no impact on latency or
-//  |                           |           |   CPU load.
-//  |                           |           |   Effect implementations setting this flag do not have
-//  |                           |           |   to implement a process function.
-//  +---------------------------+-----------+-----------------------------------
-
-// Insert mode
-#define EFFECT_FLAG_TYPE_SHIFT          0
-#define EFFECT_FLAG_TYPE_SIZE           3
-#define EFFECT_FLAG_TYPE_MASK           (((1 << EFFECT_FLAG_TYPE_SIZE) -1) \
-                                            << EFFECT_FLAG_TYPE_SHIFT)
-#define EFFECT_FLAG_TYPE_INSERT         (0 << EFFECT_FLAG_TYPE_SHIFT)
-#define EFFECT_FLAG_TYPE_AUXILIARY      (1 << EFFECT_FLAG_TYPE_SHIFT)
-#define EFFECT_FLAG_TYPE_REPLACE        (2 << EFFECT_FLAG_TYPE_SHIFT)
-#define EFFECT_FLAG_TYPE_PRE_PROC       (3 << EFFECT_FLAG_TYPE_SHIFT)
-#define EFFECT_FLAG_TYPE_POST_PROC      (4 << EFFECT_FLAG_TYPE_SHIFT)
-
-// Insert preference
-#define EFFECT_FLAG_INSERT_SHIFT        (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE)
-#define EFFECT_FLAG_INSERT_SIZE         3
-#define EFFECT_FLAG_INSERT_MASK         (((1 << EFFECT_FLAG_INSERT_SIZE) -1) \
-                                            << EFFECT_FLAG_INSERT_SHIFT)
-#define EFFECT_FLAG_INSERT_ANY          (0 << EFFECT_FLAG_INSERT_SHIFT)
-#define EFFECT_FLAG_INSERT_FIRST        (1 << EFFECT_FLAG_INSERT_SHIFT)
-#define EFFECT_FLAG_INSERT_LAST         (2 << EFFECT_FLAG_INSERT_SHIFT)
-#define EFFECT_FLAG_INSERT_EXCLUSIVE    (3 << EFFECT_FLAG_INSERT_SHIFT)
-
-
-// Volume control
-#define EFFECT_FLAG_VOLUME_SHIFT        (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE)
-#define EFFECT_FLAG_VOLUME_SIZE         3
-#define EFFECT_FLAG_VOLUME_MASK         (((1 << EFFECT_FLAG_VOLUME_SIZE) -1) \
-                                            << EFFECT_FLAG_VOLUME_SHIFT)
-#define EFFECT_FLAG_VOLUME_CTRL         (1 << EFFECT_FLAG_VOLUME_SHIFT)
-#define EFFECT_FLAG_VOLUME_IND          (2 << EFFECT_FLAG_VOLUME_SHIFT)
-#define EFFECT_FLAG_VOLUME_NONE         (0 << EFFECT_FLAG_VOLUME_SHIFT)
-
-// Device indication
-#define EFFECT_FLAG_DEVICE_SHIFT        (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE)
-#define EFFECT_FLAG_DEVICE_SIZE         3
-#define EFFECT_FLAG_DEVICE_MASK         (((1 << EFFECT_FLAG_DEVICE_SIZE) -1) \
-                                            << EFFECT_FLAG_DEVICE_SHIFT)
-#define EFFECT_FLAG_DEVICE_IND          (1 << EFFECT_FLAG_DEVICE_SHIFT)
-#define EFFECT_FLAG_DEVICE_NONE         (0 << EFFECT_FLAG_DEVICE_SHIFT)
-
-// Sample input modes
-#define EFFECT_FLAG_INPUT_SHIFT         (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE)
-#define EFFECT_FLAG_INPUT_SIZE          2
-#define EFFECT_FLAG_INPUT_MASK          (((1 << EFFECT_FLAG_INPUT_SIZE) -1) \
-                                            << EFFECT_FLAG_INPUT_SHIFT)
-#define EFFECT_FLAG_INPUT_DIRECT        (1 << EFFECT_FLAG_INPUT_SHIFT)
-#define EFFECT_FLAG_INPUT_PROVIDER      (2 << EFFECT_FLAG_INPUT_SHIFT)
-#define EFFECT_FLAG_INPUT_BOTH          (3 << EFFECT_FLAG_INPUT_SHIFT)
-
-// Sample output modes
-#define EFFECT_FLAG_OUTPUT_SHIFT        (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE)
-#define EFFECT_FLAG_OUTPUT_SIZE         2
-#define EFFECT_FLAG_OUTPUT_MASK         (((1 << EFFECT_FLAG_OUTPUT_SIZE) -1) \
-                                            << EFFECT_FLAG_OUTPUT_SHIFT)
-#define EFFECT_FLAG_OUTPUT_DIRECT       (1 << EFFECT_FLAG_OUTPUT_SHIFT)
-#define EFFECT_FLAG_OUTPUT_PROVIDER     (2 << EFFECT_FLAG_OUTPUT_SHIFT)
-#define EFFECT_FLAG_OUTPUT_BOTH         (3 << EFFECT_FLAG_OUTPUT_SHIFT)
-
-// Hardware acceleration mode
-#define EFFECT_FLAG_HW_ACC_SHIFT        (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE)
-#define EFFECT_FLAG_HW_ACC_SIZE         2
-#define EFFECT_FLAG_HW_ACC_MASK         (((1 << EFFECT_FLAG_HW_ACC_SIZE) -1) \
-                                            << EFFECT_FLAG_HW_ACC_SHIFT)
-#define EFFECT_FLAG_HW_ACC_SIMPLE       (1 << EFFECT_FLAG_HW_ACC_SHIFT)
-#define EFFECT_FLAG_HW_ACC_TUNNEL       (2 << EFFECT_FLAG_HW_ACC_SHIFT)
-
-// Audio mode indication
-#define EFFECT_FLAG_AUDIO_MODE_SHIFT    (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE)
-#define EFFECT_FLAG_AUDIO_MODE_SIZE     2
-#define EFFECT_FLAG_AUDIO_MODE_MASK     (((1 << EFFECT_FLAG_AUDIO_MODE_SIZE) -1) \
-                                            << EFFECT_FLAG_AUDIO_MODE_SHIFT)
-#define EFFECT_FLAG_AUDIO_MODE_IND      (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT)
-#define EFFECT_FLAG_AUDIO_MODE_NONE     (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT)
-
-// Audio source indication
-#define EFFECT_FLAG_AUDIO_SOURCE_SHIFT  (EFFECT_FLAG_AUDIO_MODE_SHIFT + EFFECT_FLAG_AUDIO_MODE_SIZE)
-#define EFFECT_FLAG_AUDIO_SOURCE_SIZE   2
-#define EFFECT_FLAG_AUDIO_SOURCE_MASK   (((1 << EFFECT_FLAG_AUDIO_SOURCE_SIZE) -1) \
-                                          << EFFECT_FLAG_AUDIO_SOURCE_SHIFT)
-#define EFFECT_FLAG_AUDIO_SOURCE_IND    (1 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT)
-#define EFFECT_FLAG_AUDIO_SOURCE_NONE   (0 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT)
-
-// Effect offload indication
-#define EFFECT_FLAG_OFFLOAD_SHIFT       (EFFECT_FLAG_AUDIO_SOURCE_SHIFT + \
-                                                    EFFECT_FLAG_AUDIO_SOURCE_SIZE)
-#define EFFECT_FLAG_OFFLOAD_SIZE        1
-#define EFFECT_FLAG_OFFLOAD_MASK        (((1 << EFFECT_FLAG_OFFLOAD_SIZE) -1) \
-                                          << EFFECT_FLAG_OFFLOAD_SHIFT)
-#define EFFECT_FLAG_OFFLOAD_SUPPORTED   (1 << EFFECT_FLAG_OFFLOAD_SHIFT)
-
-// Effect has no process indication
-#define EFFECT_FLAG_NO_PROCESS_SHIFT       (EFFECT_FLAG_OFFLOAD_SHIFT + \
-                                                    EFFECT_FLAG_OFFLOAD_SIZE)
-#define EFFECT_FLAG_NO_PROCESS_SIZE        1
-#define EFFECT_FLAG_NO_PROCESS_MASK        (((1 << EFFECT_FLAG_NO_PROCESS_SIZE) -1) \
-                                          << EFFECT_FLAG_NO_PROCESS_SHIFT)
-#define EFFECT_FLAG_NO_PROCESS          (1 << EFFECT_FLAG_NO_PROCESS_SHIFT)
-
 #define EFFECT_MAKE_API_VERSION(M, m)  (((M)<<16) | ((m) & 0xFFFF))
 #define EFFECT_API_VERSION_MAJOR(v)    ((v)>>16)
 #define EFFECT_API_VERSION_MINOR(v)    ((m) & 0xFFFF)
 
 
-
 /////////////////////////////////////////////////
 //      Effect control interface
 /////////////////////////////////////////////////
@@ -288,15 +68,6 @@
 // type and return its address as effect_handle_t
 typedef struct effect_interface_s **effect_handle_t;
 
-
-// Forward definition of type audio_buffer_t
-typedef struct audio_buffer_s audio_buffer_t;
-
-
-
-
-
-
 // Effect control interface definition
 struct effect_interface_s {
     ////////////////////////////////////////////////////////////////////////////////
@@ -428,496 +199,6 @@
                                audio_buffer_t *outBuffer);
 };
 
-
-//
-//--- Standardized command codes for command() function
-//
-enum effect_command_e {
-   EFFECT_CMD_INIT,                 // initialize effect engine
-   EFFECT_CMD_SET_CONFIG,           // configure effect engine (see effect_config_t)
-   EFFECT_CMD_RESET,                // reset effect engine
-   EFFECT_CMD_ENABLE,               // enable effect process
-   EFFECT_CMD_DISABLE,              // disable effect process
-   EFFECT_CMD_SET_PARAM,            // set parameter immediately (see effect_param_t)
-   EFFECT_CMD_SET_PARAM_DEFERRED,   // set parameter deferred
-   EFFECT_CMD_SET_PARAM_COMMIT,     // commit previous set parameter deferred
-   EFFECT_CMD_GET_PARAM,            // get parameter
-   EFFECT_CMD_SET_DEVICE,           // set audio device (see audio.h, audio_devices_t)
-   EFFECT_CMD_SET_VOLUME,           // set volume
-   EFFECT_CMD_SET_AUDIO_MODE,       // set the audio mode (normal, ring, ...)
-   EFFECT_CMD_SET_CONFIG_REVERSE,   // configure effect engine reverse stream(see effect_config_t)
-   EFFECT_CMD_SET_INPUT_DEVICE,     // set capture device (see audio.h, audio_devices_t)
-   EFFECT_CMD_GET_CONFIG,           // read effect engine configuration
-   EFFECT_CMD_GET_CONFIG_REVERSE,   // read configure effect engine reverse stream configuration
-   EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS,// get all supported configurations for a feature.
-   EFFECT_CMD_GET_FEATURE_CONFIG,   // get current feature configuration
-   EFFECT_CMD_SET_FEATURE_CONFIG,   // set current feature configuration
-   EFFECT_CMD_SET_AUDIO_SOURCE,     // set the audio source (see audio.h, audio_source_t)
-   EFFECT_CMD_OFFLOAD,              // set if effect thread is an offload one,
-                                    // send the ioHandle of the effect thread
-   EFFECT_CMD_FIRST_PROPRIETARY = 0x10000 // first proprietary command code
-};
-
-//==================================================================================================
-// command: EFFECT_CMD_INIT
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Initialize effect engine: All configurations return to default
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: 0
-//  data: N/A
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(int)
-//  data: status
-//==================================================================================================
-// command: EFFECT_CMD_SET_CONFIG
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Apply new audio parameters configurations for input and output buffers
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(effect_config_t)
-//  data: effect_config_t
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(int)
-//  data: status
-//==================================================================================================
-// command: EFFECT_CMD_RESET
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Reset the effect engine. Keep configuration but resets state and buffer content
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: 0
-//  data: N/A
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: 0
-//  data: N/A
-//==================================================================================================
-// command: EFFECT_CMD_ENABLE
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Enable the process. Called by the framework before the first call to process()
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: 0
-//  data: N/A
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(int)
-//  data: status
-//==================================================================================================
-// command: EFFECT_CMD_DISABLE
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Disable the process. Called by the framework after the last call to process()
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: 0
-//  data: N/A
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(int)
-//  data: status
-//==================================================================================================
-// command: EFFECT_CMD_SET_PARAM
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Set a parameter and apply it immediately
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(effect_param_t) + size of param and value
-//  data: effect_param_t + param + value. See effect_param_t definition below for value offset
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(int)
-//  data: status
-//==================================================================================================
-// command: EFFECT_CMD_SET_PARAM_DEFERRED
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Set a parameter but apply it only when receiving EFFECT_CMD_SET_PARAM_COMMIT command
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(effect_param_t) + size of param and value
-//  data: effect_param_t + param + value. See effect_param_t definition below for value offset
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: 0
-//  data: N/A
-//==================================================================================================
-// command: EFFECT_CMD_SET_PARAM_COMMIT
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Apply all previously received EFFECT_CMD_SET_PARAM_DEFERRED commands
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: 0
-//  data: N/A
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(int)
-//  data: status
-//==================================================================================================
-// command: EFFECT_CMD_GET_PARAM
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Get a parameter value
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(effect_param_t) + size of param
-//  data: effect_param_t + param
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(effect_param_t) + size of param and value
-//  data: effect_param_t + param + value. See effect_param_t definition below for value offset
-//==================================================================================================
-// command: EFFECT_CMD_SET_DEVICE
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Set the rendering device the audio output path is connected to. See audio.h, audio_devices_t
-//  for device values.
-//  The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this
-//  command when the device changes
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(uint32_t)
-//  data: uint32_t
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: 0
-//  data: N/A
-//==================================================================================================
-// command: EFFECT_CMD_SET_VOLUME
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Set and get volume. Used by audio framework to delegate volume control to effect engine.
-//  The effect implementation must set EFFECT_FLAG_VOLUME_IND or EFFECT_FLAG_VOLUME_CTRL flag in
-//  its descriptor to receive this command before every call to process() function
-//  If EFFECT_FLAG_VOLUME_CTRL flag is set in the effect descriptor, the effect engine must return
-//  the volume that should be applied before the effect is processed. The overall volume (the volume
-//  actually applied by the effect engine multiplied by the returned value) should match the value
-//  indicated in the command.
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: n * sizeof(uint32_t)
-//  data: volume for each channel defined in effect_config_t for output buffer expressed in
-//      8.24 fixed point format
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: n * sizeof(uint32_t) / 0
-//  data: - if EFFECT_FLAG_VOLUME_CTRL is set in effect descriptor:
-//              volume for each channel defined in effect_config_t for output buffer expressed in
-//              8.24 fixed point format
-//        - if EFFECT_FLAG_VOLUME_CTRL is not set in effect descriptor:
-//              N/A
-//  It is legal to receive a null pointer as pReplyData in which case the effect framework has
-//  delegated volume control to another effect
-//==================================================================================================
-// command: EFFECT_CMD_SET_AUDIO_MODE
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Set the audio mode. The effect implementation must set EFFECT_FLAG_AUDIO_MODE_IND flag in its
-//  descriptor to receive this command when the audio mode changes.
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(uint32_t)
-//  data: audio_mode_t
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: 0
-//  data: N/A
-//==================================================================================================
-// command: EFFECT_CMD_SET_CONFIG_REVERSE
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Apply new audio parameters configurations for input and output buffers of reverse stream.
-//  An example of reverse stream is the echo reference supplied to an Acoustic Echo Canceler.
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(effect_config_t)
-//  data: effect_config_t
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(int)
-//  data: status
-//==================================================================================================
-// command: EFFECT_CMD_SET_INPUT_DEVICE
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Set the capture device the audio input path is connected to. See audio.h, audio_devices_t
-//  for device values.
-//  The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this
-//  command when the device changes
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(uint32_t)
-//  data: uint32_t
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: 0
-//  data: N/A
-//==================================================================================================
-// command: EFFECT_CMD_GET_CONFIG
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Read audio parameters configurations for input and output buffers
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: 0
-//  data: N/A
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(effect_config_t)
-//  data: effect_config_t
-//==================================================================================================
-// command: EFFECT_CMD_GET_CONFIG_REVERSE
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Read audio parameters configurations for input and output buffers of reverse stream
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: 0
-//  data: N/A
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(effect_config_t)
-//  data: effect_config_t
-//==================================================================================================
-// command: EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Queries for supported configurations for a particular feature (e.g. get the supported
-// combinations of main and auxiliary channels for a noise suppressor).
-// The command parameter is the feature identifier (See effect_feature_e for a list of defined
-// features) followed by the maximum number of configuration descriptor to return.
-// The reply is composed of:
-//  - status (uint32_t):
-//          - 0 if feature is supported
-//          - -ENOSYS if the feature is not supported,
-//          - -ENOMEM if the feature is supported but the total number of supported configurations
-//          exceeds the maximum number indicated by the caller.
-//  - total number of supported configurations (uint32_t)
-//  - an array of configuration descriptors.
-// The actual number of descriptors returned must not exceed the maximum number indicated by
-// the caller.
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: 2 x sizeof(uint32_t)
-//  data: effect_feature_e + maximum number of configurations to return
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: 2 x sizeof(uint32_t) + n x sizeof (<config descriptor>)
-//  data: status + total number of configurations supported + array of n config descriptors
-//==================================================================================================
-// command: EFFECT_CMD_GET_FEATURE_CONFIG
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Retrieves current configuration for a given feature.
-// The reply status is:
-//      - 0 if feature is supported
-//      - -ENOSYS if the feature is not supported,
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(uint32_t)
-//  data: effect_feature_e
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(uint32_t) + sizeof (<config descriptor>)
-//  data: status + config descriptor
-//==================================================================================================
-// command: EFFECT_CMD_SET_FEATURE_CONFIG
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Sets current configuration for a given feature.
-// The reply status is:
-//      - 0 if feature is supported
-//      - -ENOSYS if the feature is not supported,
-//      - -EINVAL if the configuration is invalid
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(uint32_t) + sizeof (<config descriptor>)
-//  data: effect_feature_e + config descriptor
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(uint32_t)
-//  data: status
-//==================================================================================================
-// command: EFFECT_CMD_SET_AUDIO_SOURCE
-//--------------------------------------------------------------------------------------------------
-// description:
-//  Set the audio source the capture path is configured for (Camcorder, voice recognition...).
-//  See audio.h, audio_source_t for values.
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(uint32_t)
-//  data: uint32_t
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: 0
-//  data: N/A
-//==================================================================================================
-// command: EFFECT_CMD_OFFLOAD
-//--------------------------------------------------------------------------------------------------
-// description:
-//  1.indicate if the playback thread the effect is attached to is offloaded or not
-//  2.update the io handle of the playback thread the effect is attached to
-//--------------------------------------------------------------------------------------------------
-// command format:
-//  size: sizeof(effect_offload_param_t)
-//  data: effect_offload_param_t
-//--------------------------------------------------------------------------------------------------
-// reply format:
-//  size: sizeof(uint32_t)
-//  data: uint32_t
-//--------------------------------------------------------------------------------------------------
-// command: EFFECT_CMD_FIRST_PROPRIETARY
-//--------------------------------------------------------------------------------------------------
-// description:
-//  All proprietary effect commands must use command codes above this value. The size and format of
-//  command and response fields is free in this case
-//==================================================================================================
-
-
-// Audio buffer descriptor used by process(), bufferProvider() functions and buffer_config_t
-// structure. Multi-channel audio is always interleaved. The channel order is from LSB to MSB with
-// regard to the channel mask definition in audio.h, audio_channel_mask_t e.g :
-// Stereo: left, right
-// 5 point 1: front left, front right, front center, low frequency, back left, back right
-// The buffer size is expressed in frame count, a frame being composed of samples for all
-// channels at a given time. Frame size for unspecified format (AUDIO_FORMAT_OTHER) is 8 bit by
-// definition
-struct audio_buffer_s {
-    size_t   frameCount;        // number of frames in buffer
-    union {
-        void*       raw;        // raw pointer to start of buffer
-        int32_t*    s32;        // pointer to signed 32 bit data at start of buffer
-        int16_t*    s16;        // pointer to signed 16 bit data at start of buffer
-        uint8_t*    u8;         // pointer to unsigned 8 bit data at start of buffer
-    };
-};
-
-// The buffer_provider_s structure contains functions that can be used
-// by the effect engine process() function to query and release input
-// or output audio buffer.
-// The getBuffer() function is called to retrieve a buffer where data
-// should read from or written to by process() function.
-// The releaseBuffer() function MUST be called when the buffer retrieved
-// with getBuffer() is not needed anymore.
-// The process function should use the buffer provider mechanism to retrieve
-// input or output buffer if the inBuffer or outBuffer passed as argument is NULL
-// and the buffer configuration (buffer_config_t) given by the EFFECT_CMD_SET_CONFIG
-// command did not specify an audio buffer.
-
-typedef int32_t (* buffer_function_t)(void *cookie, audio_buffer_t *buffer);
-
-typedef struct buffer_provider_s {
-    buffer_function_t getBuffer;       // retrieve next buffer
-    buffer_function_t releaseBuffer;   // release used buffer
-    void       *cookie;                // for use by client of buffer provider functions
-} buffer_provider_t;
-
-
-// The buffer_config_s structure specifies the input or output audio format
-// to be used by the effect engine. It is part of the effect_config_t
-// structure that defines both input and output buffer configurations and is
-// passed by the EFFECT_CMD_SET_CONFIG or EFFECT_CMD_SET_CONFIG_REVERSE command.
-typedef struct buffer_config_s {
-    audio_buffer_t  buffer;     // buffer for use by process() function if not passed explicitly
-    uint32_t   samplingRate;    // sampling rate
-    uint32_t   channels;        // channel mask (see audio_channel_mask_t in audio.h)
-    buffer_provider_t bufferProvider;   // buffer provider
-    uint8_t    format;          // Audio format (see audio_format_t in audio.h)
-    uint8_t    accessMode;      // read/write or accumulate in buffer (effect_buffer_access_e)
-    uint16_t   mask;            // indicates which of the above fields is valid
-} buffer_config_t;
-
-// Values for "accessMode" field of buffer_config_t:
-//   overwrite, read only, accumulate (read/modify/write)
-enum effect_buffer_access_e {
-    EFFECT_BUFFER_ACCESS_WRITE,
-    EFFECT_BUFFER_ACCESS_READ,
-    EFFECT_BUFFER_ACCESS_ACCUMULATE
-
-};
-
-// feature identifiers for EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS command
-enum effect_feature_e {
-    EFFECT_FEATURE_AUX_CHANNELS, // supports auxiliary channels (e.g. dual mic noise suppressor)
-    EFFECT_FEATURE_CNT
-};
-
-// EFFECT_FEATURE_AUX_CHANNELS feature configuration descriptor. Describe a combination
-// of main and auxiliary channels supported
-typedef struct channel_config_s {
-    audio_channel_mask_t main_channels; // channel mask for main channels
-    audio_channel_mask_t aux_channels;  // channel mask for auxiliary channels
-} channel_config_t;
-
-
-// Values for bit field "mask" in buffer_config_t. If a bit is set, the corresponding field
-// in buffer_config_t must be taken into account when executing the EFFECT_CMD_SET_CONFIG command
-#define EFFECT_CONFIG_BUFFER    0x0001  // buffer field must be taken into account
-#define EFFECT_CONFIG_SMP_RATE  0x0002  // samplingRate field must be taken into account
-#define EFFECT_CONFIG_CHANNELS  0x0004  // channels field must be taken into account
-#define EFFECT_CONFIG_FORMAT    0x0008  // format field must be taken into account
-#define EFFECT_CONFIG_ACC_MODE  0x0010  // accessMode field must be taken into account
-#define EFFECT_CONFIG_PROVIDER  0x0020  // bufferProvider field must be taken into account
-#define EFFECT_CONFIG_ALL (EFFECT_CONFIG_BUFFER | EFFECT_CONFIG_SMP_RATE | \
-                           EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT | \
-                           EFFECT_CONFIG_ACC_MODE | EFFECT_CONFIG_PROVIDER)
-
-
-// effect_config_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_CONFIG
-// command to configure audio parameters and buffers for effect engine input and output.
-typedef struct effect_config_s {
-    buffer_config_t   inputCfg;
-    buffer_config_t   outputCfg;
-} effect_config_t;
-
-
-// effect_param_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_PARAM
-// command and pCmdData and pReplyData of EFFECT_CMD_GET_PARAM command.
-// psize and vsize represent the actual size of parameter and value.
-//
-// NOTE: the start of value field inside the data field is always on a 32 bit boundary:
-//
-//  +-----------+
-//  | status    | sizeof(int)
-//  +-----------+
-//  | psize     | sizeof(int)
-//  +-----------+
-//  | vsize     | sizeof(int)
-//  +-----------+
-//  |           |   |           |
-//  ~ parameter ~   > psize     |
-//  |           |   |           >  ((psize - 1)/sizeof(int) + 1) * sizeof(int)
-//  +-----------+               |
-//  | padding   |               |
-//  +-----------+
-//  |           |   |
-//  ~ value     ~   > vsize
-//  |           |   |
-//  +-----------+
-
-typedef struct effect_param_s {
-    int32_t     status;     // Transaction status (unused for command, used for reply)
-    uint32_t    psize;      // Parameter size
-    uint32_t    vsize;      // Value size
-    char        data[];     // Start of Parameter + Value data
-} effect_param_t;
-
-// structure used by EFFECT_CMD_OFFLOAD command
-typedef struct effect_offload_param_s {
-    bool isOffload;         // true if the playback thread the effect is attached to is offloaded
-    int ioHandle;           // io handle of the playback thread the effect is attached to
-} effect_offload_param_t;
-
-
 /////////////////////////////////////////////////
 //      Effect library interface
 /////////////////////////////////////////////////
diff --git a/include/hardware/fingerprint.h b/include/hardware/fingerprint.h
index 618ca7e..e7c825f 100644
--- a/include/hardware/fingerprint.h
+++ b/include/hardware/fingerprint.h
@@ -18,10 +18,12 @@
 #define ANDROID_INCLUDE_HARDWARE_FINGERPRINT_H
 
 #include <hardware/hw_auth_token.h>
+#include <hardware/hardware.h>
 
 #define FINGERPRINT_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0)
 #define FINGERPRINT_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0)
 #define FINGERPRINT_MODULE_API_VERSION_2_1 HARDWARE_MODULE_API_VERSION(2, 1)
+#define FINGERPRINT_MODULE_API_VERSION_3_0 HARDWARE_MODULE_API_VERSION(3, 0)
 #define FINGERPRINT_HARDWARE_MODULE_ID "fingerprint"
 
 typedef enum fingerprint_msg_type {
@@ -84,14 +86,13 @@
     uint64_t msg; /* Vendor specific message. Used for user guidance */
 } fingerprint_enroll_t;
 
-typedef struct fingerprint_enumerated {
+typedef struct fingerprint_iterator {
     fingerprint_finger_id_t finger;
     uint32_t remaining_templates;
-} fingerprint_enumerated_t;
+} fingerprint_iterator_t;
 
-typedef struct fingerprint_removed {
-    fingerprint_finger_id_t finger;
-} fingerprint_removed_t;
+typedef fingerprint_iterator_t fingerprint_enumerated_t;
+typedef fingerprint_iterator_t fingerprint_removed_t;
 
 typedef struct fingerprint_acquired {
     fingerprint_acquired_info_t acquired_info; /* information about the image */
@@ -206,7 +207,7 @@
     /*
      * Enumerate all the fingerprint templates found in the directory set by
      * set_active_group()
-     * For each template found notify() will be called with:
+     * For each template found a notify() will be called with:
      * fingerprint_msg.type == FINGERPRINT_TEMPLATE_ENUMERATED
      * fingerprint_msg.data.enumerated.finger indicating a template id
      * fingerprint_msg.data.enumerated.remaining_templates indicating how many more
@@ -221,9 +222,14 @@
      * Fingerprint remove request:
      * Deletes a fingerprint template.
      * Works only within the path set by set_active_group().
-     * notify() will be called with details on the template deleted.
-     * fingerprint_msg.type == FINGERPRINT_TEMPLATE_REMOVED and
-     * fingerprint_msg.data.removed.finger indicating the template id removed.
+     * The fid parameter can be used as a widcard:
+     *   * fid == 0 -- delete all the templates in the group.
+     *   * fid != 0 -- delete this specific template from the group.
+     * For each template found a notify() will be called with:
+     * fingerprint_msg.type == FINGERPRINT_TEMPLATE_REMOVED
+     * fingerprint_msg.data.removed.finger indicating a template id deleted
+     * fingerprint_msg.data.removed.remaining_templates indicating how many more
+     * templates will be deleted by this operation.
      *
      * Function return: 0 if fingerprint template(s) can be successfully deleted
      *                  or a negative number in case of error, generally from the errno.h set.
diff --git a/include/hardware/gralloc1.h b/include/hardware/gralloc1.h
index a1a2d69..f58403c 100644
--- a/include/hardware/gralloc1.h
+++ b/include/hardware/gralloc1.h
@@ -36,7 +36,10 @@
      * allocate may be NULL, which instructs the device to report whether the
      * given allocation is possible or not. */
     GRALLOC1_CAPABILITY_TEST_ALLOCATE = 1,
-    GRALLOC1_LAST_CAPABILITY = 1,
+    /* If this capability is supported, then the implementation supports
+     * allocating buffers with more than one image layer. */
+    GRALLOC1_CAPABILITY_LAYERED_BUFFERS = 2,
+    GRALLOC1_LAST_CAPABILITY = 2,
 } gralloc1_capability_t;
 
 typedef enum {
@@ -141,7 +144,9 @@
     GRALLOC1_FUNCTION_LOCK = 18,
     GRALLOC1_FUNCTION_LOCK_FLEX = 19,
     GRALLOC1_FUNCTION_UNLOCK = 20,
-    GRALLOC1_LAST_FUNCTION = 20,
+    GRALLOC1_FUNCTION_SET_LAYER_COUNT = 21,
+    GRALLOC1_FUNCTION_GET_LAYER_COUNT = 22,
+    GRALLOC1_LAST_FUNCTION = 22,
 } gralloc1_function_descriptor_t;
 
 typedef enum {
@@ -440,6 +445,30 @@
         gralloc1_device_t* device, gralloc1_buffer_descriptor_t descriptor,
         int32_t /*android_pixel_format_t*/ format);
 
+/* setLayerCount(..., layerCount)
+ * Function descriptor: GRALLOC1_FUNCTION_SET_LAYER_COUNT
+ * Must be provided by all gralloc1 devices that provide the
+ * GRALLOC1_CAPABILITY_LAYERED_BUFFERS capability.
+ *
+ * Sets the number of layers in the buffer.
+ *
+ * A buffer with multiple layers may be used as the backing store of an array
+ * texture. All layers of a buffer share the same characteristics (e.g.,
+ * dimensions, format, usage). Devices that do not support
+ * GRALLOC1_CAPABILITY_LAYERED_BUFFERS must allocate only buffers with a single
+ * layer.
+ *
+ * Parameters:
+ *   layerCount - the desired number of layers, must be non-zero
+ *
+ * Returns GRALLOC1_ERROR_NONE or one of the following errors:
+ *   GRALLOC1_ERROR_BAD_DESCRIPTOR - the buffer descriptor is invalid
+ *   GRALLOC1_ERROR_BAD_VALUE - the layer count is invalid
+ */
+typedef int32_t /*gralloc1_error_t*/ (*GRALLOC1_PFN_SET_LAYER_COUNT)(
+        gralloc1_device_t* device, gralloc1_buffer_descriptor_t descriptor,
+        uint32_t layerCount);
+
 /* setProducerUsage(..., usage)
  * Function descriptor: GRALLOC1_FUNCTION_SET_PRODUCER_USAGE
  * Must be provided by all gralloc1 devices
@@ -564,6 +593,28 @@
         gralloc1_device_t* device, buffer_handle_t descriptor,
         int32_t* outFormat);
 
+/* getLayerCount(..., outLayerCount)
+ * Function descriptor: GRALLOC1_FUNCTION_GET_LAYER_COUNT
+ * Must be provided by all gralloc1 devices that provide the
+ * GRALLOC1_CAPABILITY_LAYERED_BUFFERS capability.
+ *
+ * Gets the number of layers of the buffer.
+ *
+ * See setLayerCount for more information about this value.
+ *
+ * Parameters:
+ *   outLayerCount - the number of layers in the image, must be non-NULL
+ *
+ * Returns GRALLOC1_ERROR_NONE or one of the following errors:
+ *   GRALLOC1_ERROR_BAD_HANDLE - the buffer handle is invalid
+ *   GRALLOC1_ERROR_UNSUPPORTED - the device is unable to retrieve the
+ *       layer count from the buffer; see note [1] in this section's header for
+ *       more information
+ */
+typedef int32_t /*gralloc1_error_t*/ (*GRALLOC1_PFN_GET_LAYER_COUNT)(
+        gralloc1_device_t* device, buffer_handle_t buffer,
+        uint32_t* outLayerCount);
+
 /* getProducerUsage(..., outUsage)
  * Function descriptor: GRALLOC1_FUNCTION_GET_PRODUCER_USAGE
  * Must be provided by all gralloc1 devices
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index 7eca7c1..9eb1aaf 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -481,6 +481,7 @@
     struct hw_module_t common;
 } hwc_module_t;
 
+#define HWC_ERROR (-1)
 typedef struct hwc_composer_device_1 {
     /**
      * Common methods of the hardware composer device.  This *must* be the first member of
@@ -714,9 +715,9 @@
      * (*getActiveConfig)() returns the index of the configuration that is
      * currently active on the connected display. The index is relative to
      * the list of configuration handles returned by getDisplayConfigs. If there
-     * is no active configuration, -1 shall be returned.
+     * is no active configuration, HWC_ERROR shall be returned.
      *
-     * Returns the configuration index on success or -1 on error.
+     * Returns the configuration index on success or HWC_ERROR on error.
      *
      * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_4 and later.
      * It shall be NULL for previous versions.
diff --git a/include/hardware/hwcomposer_defs.h b/include/hardware/hwcomposer_defs.h
index 18b30bc..1e81e6e 100644
--- a/include/hardware/hwcomposer_defs.h
+++ b/include/hardware/hwcomposer_defs.h
@@ -136,9 +136,9 @@
  */
 enum {
     /*
-     * HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL
+     * HWC_SKIP_LAYER is set by SurfaceFlinger to indicate that the HAL
      * shall not consider this layer for composition as it will be handled
-     * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY).
+     * by SurfaceFlinger (just as if compositionType was set to HWC_FRAMEBUFFER).
      */
     HWC_SKIP_LAYER = 0x00000001,
 
diff --git a/include/hardware/keymaster_defs.h b/include/hardware/keymaster_defs.h
index 0f9bc27..323b7dd 100644
--- a/include/hardware/keymaster_defs.h
+++ b/include/hardware/keymaster_defs.h
@@ -135,6 +135,9 @@
     KM_TAG_OS_PATCHLEVEL = KM_UINT | 706,          /* Patch level of system (keymaster2) */
     KM_TAG_UNIQUE_ID = KM_BYTES | 707,             /* Used to provide unique ID in attestation */
     KM_TAG_ATTESTATION_CHALLENGE = KM_BYTES | 708, /* Used to provide challenge in attestation */
+    KM_TAG_ATTESTATION_APPLICATION_ID = KM_BYTES | 709, /* Used to identify the set of possible
+                                                         * applications of which one has initiated
+                                                         * a key attestation */
 
     /* Tags used only to provide data to or receive data from operations */
     KM_TAG_ASSOCIATED_DATA = KM_BYTES | 1000, /* Used to provide associated data for AEAD modes. */
@@ -427,6 +430,7 @@
     KM_ERROR_KEY_REQUIRES_UPGRADE = -62,
     KM_ERROR_ATTESTATION_CHALLENGE_MISSING = -63,
     KM_ERROR_KEYMASTER_NOT_CONFIGURED = -64,
+    KM_ERROR_ATTESTATION_APPLICATION_ID_MISSING = -65,
 
     KM_ERROR_UNIMPLEMENTED = -100,
     KM_ERROR_VERSION_MISMATCH = -101,
diff --git a/include/hardware/sensors-base.h b/include/hardware/sensors-base.h
new file mode 100644
index 0000000..973c8d7
--- /dev/null
+++ b/include/hardware/sensors-base.h
@@ -0,0 +1,99 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+#ifndef HIDL_GENERATED_android_hardware_sensors_V1_0_EXPORTED_CONSTANTS_H_
+#define HIDL_GENERATED_android_hardware_sensors_V1_0_EXPORTED_CONSTANTS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+    SENSOR_HAL_NORMAL_MODE = 0,
+    SENSOR_HAL_DATA_INJECTION_MODE = 1,
+};
+
+enum {
+    SENSOR_TYPE_META_DATA = 0,
+    SENSOR_TYPE_ACCELEROMETER = 1,
+    SENSOR_TYPE_GEOMAGNETIC_FIELD = 2,
+    SENSOR_TYPE_ORIENTATION = 3,
+    SENSOR_TYPE_GYROSCOPE = 4,
+    SENSOR_TYPE_LIGHT = 5,
+    SENSOR_TYPE_PRESSURE = 6,
+    SENSOR_TYPE_TEMPERATURE = 7,
+    SENSOR_TYPE_PROXIMITY = 8,
+    SENSOR_TYPE_GRAVITY = 9,
+    SENSOR_TYPE_LINEAR_ACCELERATION = 10,
+    SENSOR_TYPE_ROTATION_VECTOR = 11,
+    SENSOR_TYPE_RELATIVE_HUMIDITY = 12,
+    SENSOR_TYPE_AMBIENT_TEMPERATURE = 13,
+    SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14,
+    SENSOR_TYPE_GAME_ROTATION_VECTOR = 15,
+    SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 16,
+    SENSOR_TYPE_SIGNIFICANT_MOTION = 17,
+    SENSOR_TYPE_STEP_DETECTOR = 18,
+    SENSOR_TYPE_STEP_COUNTER = 19,
+    SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20,
+    SENSOR_TYPE_HEART_RATE = 21,
+    SENSOR_TYPE_TILT_DETECTOR = 22,
+    SENSOR_TYPE_WAKE_GESTURE = 23,
+    SENSOR_TYPE_GLANCE_GESTURE = 24,
+    SENSOR_TYPE_PICK_UP_GESTURE = 25,
+    SENSOR_TYPE_WRIST_TILT_GESTURE = 26,
+    SENSOR_TYPE_DEVICE_ORIENTATION = 27,
+    SENSOR_TYPE_POSE_6DOF = 28,
+    SENSOR_TYPE_STATIONARY_DETECT = 29,
+    SENSOR_TYPE_MOTION_DETECT = 30,
+    SENSOR_TYPE_HEART_BEAT = 31,
+    SENSOR_TYPE_DYNAMIC_SENSOR_META = 32,
+    SENSOR_TYPE_ADDITIONAL_INFO = 33,
+    SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34,
+    SENSOR_TYPE_DEVICE_PRIVATE_BASE = 65536, // 0x10000
+};
+
+enum {
+    SENSOR_FLAG_WAKE_UP = 1ull, // 1
+    SENSOR_FLAG_CONTINUOUS_MODE = 0ull, // 0
+    SENSOR_FLAG_ON_CHANGE_MODE = 2ull, // 2
+    SENSOR_FLAG_ONE_SHOT_MODE = 4ull, // 4
+    SENSOR_FLAG_SPECIAL_REPORTING_MODE = 6ull, // 6
+    SENSOR_FLAG_SUPPORTS_DATA_INJECTION = 16ull, // 0x10
+    SENSOR_FLAG_DYNAMIC_SENSOR = 32ull, // 0x20
+    SENSOR_FLAG_ADDITIONAL_INFO = 64ull, // 0x40
+};
+
+enum {
+    SENSOR_STATUS_NO_CONTACT = -1, // (-1)
+    SENSOR_STATUS_UNRELIABLE = 0,
+    SENSOR_STATUS_ACCURACY_LOW = 1,
+    SENSOR_STATUS_ACCURACY_MEDIUM = 2,
+    SENSOR_STATUS_ACCURACY_HIGH = 3,
+};
+
+enum {
+    META_DATA_FLUSH_COMPLETE = 1u, // 1
+};
+
+typedef enum {
+    AINFO_BEGIN = 0u, // 0
+    AINFO_END = 1u, // 1
+    AINFO_UNTRACKED_DELAY = 65536u, // 0x10000
+    AINFO_INTERNAL_TEMPERATURE = 65537u, // 65537
+    AINFO_VEC3_CALIBRATION = 65538u, // 65538
+    AINFO_SENSOR_PLACEMENT = 65539u, // 65539
+    AINFO_SAMPLING = 65540u, // 65540
+    AINFO_CHANNEL_NOISE = 131072u, // 0x20000
+    AINFO_CHANNEL_SAMPLER = 131073u, // 131073
+    AINFO_CHANNEL_FILTER = 131074u, // 131074
+    AINFO_CHANNEL_LINEAR_TRANSFORM = 131075u, // 131075
+    AINFO_CHANNEL_NONLINEAR_MAP = 131076u, // 131076
+    AINFO_CHANNEL_RESAMPLER = 131077u, // 131077
+    AINFO_CUSTOM_START = 268435456u, // 0x10000000
+    AINFO_DEBUGGING_START = 1073741824u, // 0x40000000
+} additional_info_type_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // HIDL_GENERATED_android_hardware_sensors_V1_0_EXPORTED_CONSTANTS_H_
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index c872d8e..08a65f8 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -24,6 +24,8 @@
 #include <hardware/hardware.h>
 #include <cutils/native_handle.h>
 
+#include "sensors-base.h"
+
 __BEGIN_DECLS
 
 /*****************************************************************************/
@@ -82,7 +84,7 @@
  */
 enum {
     /* a previous flush operation has completed */
-    META_DATA_FLUSH_COMPLETE = 1,
+    // META_DATA_FLUSH_COMPLETE = 1,
     META_DATA_VERSION   /* always last, leave auto-assigned */
 };
 
@@ -97,24 +99,6 @@
  * Availability: SENSORS_DEVICE_API_VERSION_1_4
  * Sensor HAL modes used in set_operation_mode method
  */
-enum {
-    /*
-     * Operating modes for the HAL.
-     */
-
-    /*
-     * Normal mode operation. This is the default state of operation.
-     * The HAL shall initialize into this mode on device startup.
-     */
-    SENSOR_HAL_NORMAL_MODE        = 0,
-
-    /*
-     * Data Injection mode. In this mode, the device shall not source data from the
-     * physical sensors as it would in normal mode. Instead sensor data is
-     * injected by the sensor service.
-     */
-    SENSOR_HAL_DATA_INJECTION_MODE      = 0x1
-};
 
 #define SENSOR_FLAG_MASK(nbit, shift)   (((1<<(nbit))-1)<<(shift))
 #define SENSOR_FLAG_MASK_1(shift)       SENSOR_FLAG_MASK(1, shift)
@@ -145,723 +129,41 @@
 #define ADDITIONAL_INFO_SHIFT           (6)
 #define ADDITIONAL_INFO_MASK            SENSOR_FLAG_MASK_1(ADDITIONAL_INFO_SHIFT) //0x40
 
-/*
- * Availability: SENSORS_DEVICE_API_VERSION_1_3
- * Sensor flags used in sensor_t.flags.
- */
-enum {
-    /*
-     * Whether this sensor wakes up the AP from suspend mode when data is available.  Whenever
-     * sensor events are delivered from a wake_up sensor, the driver needs to hold a wake_lock till
-     * the events are read by the SensorService i.e till sensors_poll_device_t.poll() is called the
-     * next time. Once poll is called again it means events have been read by the SensorService, the
-     * driver can safely release the wake_lock. SensorService will continue to hold a wake_lock till
-     * the app actually reads the events.
-     */
-    SENSOR_FLAG_WAKE_UP = 1U << 0,
-    /*
-     * Reporting modes for various sensors. Each sensor will have exactly one of these modes set.
-     * The least significant 2nd, 3rd and 4th bits are used to represent four possible reporting
-     * modes.
-     */
-    SENSOR_FLAG_CONTINUOUS_MODE        = 0,    // 0000
-    SENSOR_FLAG_ON_CHANGE_MODE         = 0x2,  // 0010
-    SENSOR_FLAG_ONE_SHOT_MODE          = 0x4,  // 0100
-    SENSOR_FLAG_SPECIAL_REPORTING_MODE = 0x6,  // 0110
-
-    /*
-     * Set this flag if the sensor supports data_injection mode and allows data to be injected
-     * from the SensorService. When in data_injection ONLY sensors with this flag set are injected
-     * sensor data and only sensors with this flag set are activated. Eg: Accelerometer and Step
-     * Counter sensors can be set with this flag and SensorService will inject accelerometer data
-     * and read the corresponding step counts.
-     */
-    SENSOR_FLAG_SUPPORTS_DATA_INJECTION = DATA_INJECTION_MASK, // 1 0000
-
-    /*
-     * Set this flag if the sensor is a dynamically connected sensor. See
-     * dynamic_sensor_meta_event_t and SENSOR_TYPE_DYNAMIC_SENSOR_META for details.
-     */
-    SENSOR_FLAG_DYNAMIC_SENSOR = DYNAMIC_SENSOR_MASK,
-
-    /*
-     * Set this flag if sensor additional information is supported. See SENSOR_TYPE_ADDITIONAL_INFO
-     * and additional_info_event_t for details.
-     */
-    SENSOR_FLAG_ADDITIONAL_INFO = ADDITIONAL_INFO_MASK
-};
-
-
-/*
- * Sensor type
- *
- * Each sensor has a type which defines what this sensor measures and how
- * measures are reported. See the Base sensors and Composite sensors lists
- * for complete descriptions:
- * http://source.android.com/devices/sensors/base_triggers.html
- * http://source.android.com/devices/sensors/composite_sensors.html
- *
- * Device manufacturers (OEMs) can define their own sensor types, for
- * their private use by applications or services provided by them. Such
- * sensor types are specific to an OEM and can't be exposed in the SDK.
- * These types must start at SENSOR_TYPE_DEVICE_PRIVATE_BASE.
- *
- * All sensors defined outside of the device private range must correspond to
- * a type defined in this file, and must satisfy the characteristics listed in
- * the description of the sensor type.
- *
- * Starting with version SENSORS_DEVICE_API_VERSION_1_2, each sensor also
- * has a stringType.
- *  - StringType of sensors inside of the device private range MUST be prefixed
- *    by the sensor provider's or OEM reverse domain name. In particular, they
- *    cannot use the "android.sensor" prefix.
- *  - StringType of sensors outside of the device private range MUST correspond
- *    to the one defined in this file (starting with "android.sensor").
- *    For example, accelerometers must have
- *      type=SENSOR_TYPE_ACCELEROMETER and
- *      stringType=SENSOR_STRING_TYPE_ACCELEROMETER
- *
- * When android introduces a new sensor type that can replace an OEM-defined
- * sensor type, the OEM must use the official sensor type and stringType on
- * versions of the HAL that support this new official sensor type.
- *
- * Example (made up): Suppose Google's Glass team wants to surface a sensor
- * detecting that Glass is on a head.
- *  - Such a sensor is not officially supported in android KitKat
- *  - Glass devices launching on KitKat can implement a sensor with
- *    type = 0x10001 and stringType = "com.google.glass.onheaddetector"
- *  - In L android release, if android decides to define
- *    SENSOR_TYPE_ON_HEAD_DETECTOR and STRING_SENSOR_TYPE_ON_HEAD_DETECTOR,
- *    those types should replace the Glass-team-specific types in all future
- *    launches.
- *  - When launching Glass on the L release, Google should now use the official
- *    type (SENSOR_TYPE_ON_HEAD_DETECTOR) and stringType.
- *  - This way, all applications can now use this sensor.
- */
-
-/*
- * Base for device manufacturers private sensor types.
- * These sensor types can't be exposed in the SDK.
- */
-#define SENSOR_TYPE_DEVICE_PRIVATE_BASE     0x10000
-
-/*
- * SENSOR_TYPE_META_DATA
- * reporting-mode: n/a
- * wake-up sensor: n/a
- *
- * NO SENSOR OF THAT TYPE MUST BE RETURNED (*get_sensors_list)()
- *
- * SENSOR_TYPE_META_DATA is a special token used to populate the
- * sensors_meta_data_event structure. It doesn't correspond to a physical
- * sensor. sensors_meta_data_event are special, they exist only inside
- * the HAL and are generated spontaneously, as opposed to be related to
- * a physical sensor.
- *
- *   sensors_meta_data_event_t.version must be META_DATA_VERSION
- *   sensors_meta_data_event_t.sensor must be 0
- *   sensors_meta_data_event_t.type must be SENSOR_TYPE_META_DATA
- *   sensors_meta_data_event_t.reserved must be 0
- *   sensors_meta_data_event_t.timestamp must be 0
- *
- * The payload is a meta_data_event_t, where:
- * meta_data_event_t.what can take the following values:
- *
- * META_DATA_FLUSH_COMPLETE
- *   This event indicates that a previous (*flush)() call has completed for the sensor
- *   handle specified in meta_data_event_t.sensor.
- *   see (*flush)() for more details
- *
- * All other values for meta_data_event_t.what are reserved and
- * must not be used.
- *
- */
-#define SENSOR_TYPE_META_DATA                        (0)
-
-/*
-  * Wake up sensors.
-  * Each sensor may have either or both a wake-up and a non-wake variant.
-  * When registered in batch mode, wake-up sensors will wake up the AP when
-  * their FIFOs are full or when the batch timeout expires. A separate FIFO has
-  * to be maintained for wake up sensors and non wake up sensors. The non wake-up
-  * sensors need to overwrite their FIFOs when they are full till the AP wakes up
-  * and the wake-up sensors will wake-up the AP when their FIFOs are full or when
-  * the batch timeout expires without losing events. Wake-up and non wake-up variants
-  * of each sensor can be activated at different rates independently of each other.
-  *
-  * Note: Proximity sensor and significant motion sensor which were defined in previous
-  * releases are also wake-up sensors and should be treated as such. Wake-up one-shot
-  * sensors like SIGNIFICANT_MOTION cannot be batched, hence the text about batch above
-  * doesn't apply to them. See the definitions of SENSOR_TYPE_PROXIMITY and
-  * SENSOR_TYPE_SIGNIFICANT_MOTION for more info.
-  *
-  * Set SENSOR_FLAG_WAKE_UP flag for all wake-up sensors.
-  *
-  * For example, A device can have two sensors both of SENSOR_TYPE_ACCELEROMETER and
-  * one of them can be a wake_up sensor (with SENSOR_FLAG_WAKE_UP flag set) and the other
-  * can be a regular non wake_up sensor. Both of these sensors must be activated/deactivated
-  * independently of the other.
-  */
-
-/*
- * SENSOR_TYPE_ACCELEROMETER
- * reporting-mode: continuous
- *
- *  All values are in SI units (m/s^2) and measure the acceleration of the
- *  device minus the force of gravity.
- *
- *  Implement the non-wake-up version of this sensor and implement the wake-up
- *  version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_ACCELEROMETER                    (1)
 #define SENSOR_STRING_TYPE_ACCELEROMETER             "android.sensor.accelerometer"
-
-/*
- * SENSOR_TYPE_GEOMAGNETIC_FIELD
- * reporting-mode: continuous
- *
- *  All values are in micro-Tesla (uT) and measure the geomagnetic
- *  field in the X, Y and Z axis.
- *
- *  Implement the non-wake-up version of this sensor and implement the wake-up
- *  version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_GEOMAGNETIC_FIELD                (2)
 #define SENSOR_TYPE_MAGNETIC_FIELD  SENSOR_TYPE_GEOMAGNETIC_FIELD
 #define SENSOR_STRING_TYPE_MAGNETIC_FIELD            "android.sensor.magnetic_field"
-
-/*
- * SENSOR_TYPE_ORIENTATION
- * reporting-mode: continuous
- *
- * All values are angles in degrees.
- *
- * Orientation sensors return sensor events for all 3 axes at a constant
- * rate defined by setDelay().
- *
- * Implement the non-wake-up version of this sensor and implement the wake-up
- * version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_ORIENTATION                      (3)
 #define SENSOR_STRING_TYPE_ORIENTATION               "android.sensor.orientation"
-
-/*
- * SENSOR_TYPE_GYROSCOPE
- * reporting-mode: continuous
- *
- *  All values are in radians/second and measure the rate of rotation
- *  around the X, Y and Z axis.
- *
- *  Implement the non-wake-up version of this sensor and implement the wake-up
- *  version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_GYROSCOPE                        (4)
 #define SENSOR_STRING_TYPE_GYROSCOPE                 "android.sensor.gyroscope"
-
-/*
- * SENSOR_TYPE_LIGHT
- * reporting-mode: on-change
- *
- * The light sensor value is returned in SI lux units.
- *
- * Both wake-up and non wake-up versions are useful.
- */
-#define SENSOR_TYPE_LIGHT                            (5)
 #define SENSOR_STRING_TYPE_LIGHT                     "android.sensor.light"
-
-/*
- * SENSOR_TYPE_PRESSURE
- * reporting-mode: continuous
- *
- * The pressure sensor return the athmospheric pressure in hectopascal (hPa)
- *
- * Implement the non-wake-up version of this sensor and implement the wake-up
- * version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_PRESSURE                         (6)
 #define SENSOR_STRING_TYPE_PRESSURE                  "android.sensor.pressure"
-
-/* SENSOR_TYPE_TEMPERATURE is deprecated in the HAL */
-#define SENSOR_TYPE_TEMPERATURE                      (7)
 #define SENSOR_STRING_TYPE_TEMPERATURE               "android.sensor.temperature"
-
-/*
- * SENSOR_TYPE_PROXIMITY
- * reporting-mode: on-change
- *
- * The proximity sensor which turns the screen off and back on during calls is the
- * wake-up proximity sensor. Implement wake-up proximity sensor before implementing
- * a non wake-up proximity sensor. For the wake-up proximity sensor set the flag
- * SENSOR_FLAG_WAKE_UP.
- * The value corresponds to the distance to the nearest object in centimeters.
- */
-#define SENSOR_TYPE_PROXIMITY                        (8)
 #define SENSOR_STRING_TYPE_PROXIMITY                 "android.sensor.proximity"
-
-/*
- * SENSOR_TYPE_GRAVITY
- * reporting-mode: continuous
- *
- * A gravity output indicates the direction of and magnitude of gravity in
- * the devices's coordinates.
- *
- * Implement the non-wake-up version of this sensor and implement the wake-up
- * version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_GRAVITY                          (9)
 #define SENSOR_STRING_TYPE_GRAVITY                   "android.sensor.gravity"
-
-/*
- * SENSOR_TYPE_LINEAR_ACCELERATION
- * reporting-mode: continuous
- *
- * Indicates the linear acceleration of the device in device coordinates,
- * not including gravity.
- *
- * Implement the non-wake-up version of this sensor and implement the wake-up
- * version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_LINEAR_ACCELERATION             (10)
 #define SENSOR_STRING_TYPE_LINEAR_ACCELERATION      "android.sensor.linear_acceleration"
-
-
-/*
- * SENSOR_TYPE_ROTATION_VECTOR
- * reporting-mode: continuous
- *
- * The rotation vector symbolizes the orientation of the device relative to the
- * East-North-Up coordinates frame.
- *
- * Implement the non-wake-up version of this sensor and implement the wake-up
- * version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_ROTATION_VECTOR                 (11)
 #define SENSOR_STRING_TYPE_ROTATION_VECTOR          "android.sensor.rotation_vector"
-
-/*
- * SENSOR_TYPE_RELATIVE_HUMIDITY
- * reporting-mode: on-change
- *
- * A relative humidity sensor measures relative ambient air humidity and
- * returns a value in percent.
- *
- * Both wake-up and non wake-up versions are useful.
- */
-#define SENSOR_TYPE_RELATIVE_HUMIDITY               (12)
 #define SENSOR_STRING_TYPE_RELATIVE_HUMIDITY        "android.sensor.relative_humidity"
-
-/*
- * SENSOR_TYPE_AMBIENT_TEMPERATURE
- * reporting-mode: on-change
- *
- * The ambient (room) temperature in degree Celsius.
- *
- * Both wake-up and non wake-up versions are useful.
- */
-#define SENSOR_TYPE_AMBIENT_TEMPERATURE             (13)
 #define SENSOR_STRING_TYPE_AMBIENT_TEMPERATURE      "android.sensor.ambient_temperature"
-
-/*
- * SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED
- * reporting-mode: continuous
- *
- *  Similar to SENSOR_TYPE_MAGNETIC_FIELD, but the hard iron calibration is
- *  reported separately instead of being included in the measurement.
- *
- *  Implement the non-wake-up version of this sensor and implement the wake-up
- *  version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED     (14)
 #define SENSOR_STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED "android.sensor.magnetic_field_uncalibrated"
-
-/*
- * SENSOR_TYPE_GAME_ROTATION_VECTOR
- * reporting-mode: continuous
- *
- *  Similar to SENSOR_TYPE_ROTATION_VECTOR, but not using the geomagnetic
- *  field.
- *
- *  Implement the non-wake-up version of this sensor and implement the wake-up
- *  version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_GAME_ROTATION_VECTOR            (15)
 #define SENSOR_STRING_TYPE_GAME_ROTATION_VECTOR     "android.sensor.game_rotation_vector"
-
-/*
- * SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
- * reporting-mode: continuous
- *
- *  All values are in radians/second and measure the rate of rotation
- *  around the X, Y and Z axis.
- *
- *  Implement the non-wake-up version of this sensor and implement the wake-up
- *  version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED          (16)
 #define SENSOR_STRING_TYPE_GYROSCOPE_UNCALIBRATED   "android.sensor.gyroscope_uncalibrated"
-
-/*
- * SENSOR_TYPE_SIGNIFICANT_MOTION
- * reporting-mode: one-shot
- *
- * A sensor of this type triggers an event each time significant motion
- * is detected and automatically disables itself.
- * For Significant Motion sensor to be useful, it must be defined as a
- * wake-up sensor. (set SENSOR_FLAG_WAKE_UP). Implement the wake-up significant motion
- * sensor. A non wake-up version is not useful.
- * The only allowed value to return is 1.0.
- */
-
-#define SENSOR_TYPE_SIGNIFICANT_MOTION              (17)
 #define SENSOR_STRING_TYPE_SIGNIFICANT_MOTION       "android.sensor.significant_motion"
-
-/*
- * SENSOR_TYPE_STEP_DETECTOR
- * reporting-mode: special
- *
- * A sensor of this type triggers an event each time a step is taken
- * by the user. The only allowed value to return is 1.0 and an event
- * is generated for each step.
- *
- * Both wake-up and non wake-up versions are useful.
- */
-
-#define SENSOR_TYPE_STEP_DETECTOR                   (18)
 #define SENSOR_STRING_TYPE_STEP_DETECTOR            "android.sensor.step_detector"
-
-
-/*
- * SENSOR_TYPE_STEP_COUNTER
- * reporting-mode: on-change
- *
- * A sensor of this type returns the number of steps taken by the user since
- * the last reboot while activated. The value is returned as a uint64_t and is
- * reset to zero only on a system / android reboot.
- *
- * Implement the non-wake-up version of this sensor and implement the wake-up
- * version if the system possesses a wake up fifo.
- */
-
-#define SENSOR_TYPE_STEP_COUNTER                    (19)
 #define SENSOR_STRING_TYPE_STEP_COUNTER             "android.sensor.step_counter"
-
-/*
- * SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
- * reporting-mode: continuous
- *
- *  Similar to SENSOR_TYPE_ROTATION_VECTOR, but using a magnetometer instead
- *  of using a gyroscope.
- *
- * Implement the non-wake-up version of this sensor and implement the wake-up
- * version if the system possesses a wake up fifo.
- */
-#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR     (20)
 #define SENSOR_STRING_TYPE_GEOMAGNETIC_ROTATION_VECTOR "android.sensor.geomagnetic_rotation_vector"
-
-/*
- * SENSOR_TYPE_HEART_RATE
- * reporting-mode: on-change
- *
- *  A sensor of this type returns the current heart rate.
- *  The events contain the current heart rate in beats per minute (BPM) and the
- *  status of the sensor during the measurement. See heart_rate_event_t for more
- *  details.
- *
- *  Because this sensor is on-change, events must be generated when and only
- *  when heart_rate.bpm or heart_rate.status have changed since the last
- *  event. In particular, upon the first activation, unless the device is known
- *  to not be on the body, the status field of the first event must be set to
- *  SENSOR_STATUS_UNRELIABLE. The event should be generated no faster than every
- *  period_ns passed to setDelay() or to batch().
- *  See the definition of the on-change reporting mode for more information.
- *
- *  sensor_t.requiredPermission must be set to SENSOR_PERMISSION_BODY_SENSORS.
- *
- *  Both wake-up and non wake-up versions are useful.
- */
-#define SENSOR_TYPE_HEART_RATE                      (21)
 #define SENSOR_STRING_TYPE_HEART_RATE               "android.sensor.heart_rate"
-
-/*
- * SENSOR_TYPE_WAKE_UP_TILT_DETECTOR
- * reporting-mode: special (setDelay has no impact)
- *
- * A sensor of this type generates an event each time a tilt event is detected. A tilt event
- * should be generated if the direction of the 2-seconds window average gravity changed by at least
- * 35 degrees since the activation or the last trigger of the sensor.
- *     reference_estimated_gravity = average of accelerometer measurements over the first
- *                                 1 second after activation or the estimated gravity at the last
- *                                 trigger.
- *     current_estimated_gravity = average of accelerometer measurements over the last 2 seconds.
- *     trigger when angle (reference_estimated_gravity, current_estimated_gravity) > 35 degrees
- *
- * Large accelerations without a change in phone orientation should not trigger a tilt event.
- * For example, a sharp turn or strong acceleration while driving a car should not trigger a tilt
- * event, even though the angle of the average acceleration might vary by more than 35 degrees.
- *
- * Typically, this sensor is implemented with the help of only an accelerometer. Other sensors can
- * be used as well if they do not increase the power consumption significantly. This is a low power
- * sensor that should allow the AP to go into suspend mode. Do not emulate this sensor in the HAL.
- * Like other wake up sensors, the driver is expected to a hold a wake_lock with a timeout of 200 ms
- * while reporting this event. The only allowed return value is 1.0.
- *
- * Implement only the wake-up version of this sensor.
- */
-#define SENSOR_TYPE_TILT_DETECTOR                      (22)
 #define SENSOR_STRING_TYPE_TILT_DETECTOR               "android.sensor.tilt_detector"
-
-/*
- * SENSOR_TYPE_WAKE_GESTURE
- * reporting-mode: one-shot
- *
- * A sensor enabling waking up the device based on a device specific motion.
- *
- * When this sensor triggers, the device behaves as if the power button was
- * pressed, turning the screen on. This behavior (turning on the screen when
- * this sensor triggers) might be deactivated by the user in the device
- * settings. Changes in settings do not impact the behavior of the sensor:
- * only whether the framework turns the screen on when it triggers.
- *
- * The actual gesture to be detected is not specified, and can be chosen by
- * the manufacturer of the device.
- * This sensor must be low power, as it is likely to be activated 24/7.
- * The only allowed value to return is 1.0.
- *
- * Implement only the wake-up version of this sensor.
- */
-#define SENSOR_TYPE_WAKE_GESTURE                               (23)
 #define SENSOR_STRING_TYPE_WAKE_GESTURE                        "android.sensor.wake_gesture"
-
-/*
- * SENSOR_TYPE_GLANCE_GESTURE
- * reporting-mode: one-shot
- *
- * A sensor enabling briefly turning the screen on to enable the user to
- * glance content on screen based on a specific motion.  The device should
- * turn the screen off after a few moments.
- *
- * When this sensor triggers, the device turns the screen on momentarily
- * to allow the user to glance notifications or other content while the
- * device remains locked in a non-interactive state (dozing). This behavior
- * (briefly turning on the screen when this sensor triggers) might be deactivated
- * by the user in the device settings. Changes in settings do not impact the
- * behavior of the sensor: only whether the framework briefly turns the screen on
- * when it triggers.
- *
- * The actual gesture to be detected is not specified, and can be chosen by
- * the manufacturer of the device.
- * This sensor must be low power, as it is likely to be activated 24/7.
- * The only allowed value to return is 1.0.
- *
- * Implement only the wake-up version of this sensor.
- */
-#define SENSOR_TYPE_GLANCE_GESTURE                             (24)
 #define SENSOR_STRING_TYPE_GLANCE_GESTURE                      "android.sensor.glance_gesture"
-
-/**
- * SENSOR_TYPE_PICK_UP_GESTURE
- * reporting-mode: one-shot
- *
- * A sensor of this type triggers when the device is picked up regardless of wherever is was
- * before (desk, pocket, bag). The only allowed return value is 1.0.
- * This sensor de-activates itself immediately after it triggers.
- *
- * Implement only the wake-up version of this sensor.
- */
-#define SENSOR_TYPE_PICK_UP_GESTURE                            (25)
 #define SENSOR_STRING_TYPE_PICK_UP_GESTURE                     "android.sensor.pick_up_gesture"
-
-/*
- * SENSOR_TYPE_WRIST_TILT_GESTURE
- * trigger-mode: special
- * wake-up sensor: yes
- *
- * A sensor of this type triggers an event each time a tilt of the wrist-worn
- * device is detected.
- *
- * This sensor must be low power, as it is likely to be activated 24/7.
- * The only allowed value to return is 1.0.
- *
- * Implement only the wake-up version of this sensor.
- */
-#define SENSOR_TYPE_WRIST_TILT_GESTURE                         (26)
 #define SENSOR_STRING_TYPE_WRIST_TILT_GESTURE                  "android.sensor.wrist_tilt_gesture"
-
-/*
- * SENSOR_TYPE_DEVICE_ORIENTATION
- * reporting-mode: on-change
- *
- * The current orientation of the device. The value should be reported in the
- * first element of the 'data' member variable in sensors_event_t. The only
- * values that can be reported are (please refer to Android Sensor Coordinate
- * System to understand the X and Y axis direction with respect to default
- * orientation):
- *  - 0: device is in default orientation (Y axis is vertical and points up)
- *  - 1: device is rotated 90 degrees counter-clockwise from default
- *       orientation (X axis is vertical and points up)
- *  - 2: device is rotated 180 degrees from default orientation (Y axis is
- *       vertical and points down)
- *  - 3: device is rotated 90 degrees clockwise from default orientation (X axis
- *       is vertical and points down)
- *
- * Moving the device to an orientation where the Z axis is vertical (either up
- * or down) should not cause a new event to be reported.
- *
- * To improve the user experience of this sensor, it is recommended to implement
- * some physical (i.e., rotation angle) and temporal (i.e., delay) hysteresis.
- * In other words, minor or transient rotations should not cause a new event to
- * be reported.
- *
- * This sensor should only be implemented with the help of an accelerometer.
- * This is a low power sensor that should reduce the number of interrupts of the
- * AP. Do not emulate this sensor in the HAL.
- *
- * Both wake-up and non wake-up versions are useful.
- */
-#define SENSOR_TYPE_DEVICE_ORIENTATION                 (27)
 #define SENSOR_STRING_TYPE_DEVICE_ORIENTATION          "android.sensor.device_orientation"
-
-/*
- * SENSOR_TYPE_POSE_6DOF
- * trigger-mode: continuous
- *
- * A sensor of this type returns the pose of the device.
- * Pose of the device is defined as the orientation of the device from a
- * Earth Centered Earth Fixed frame and the translation from an arbitrary
- * point at subscription.
- *
- * This sensor can be high power. It can use any and all of the following
- *           . Accelerometer
- *           . Gyroscope
- *           . Camera
- *           . Depth Camera
- *
- */
-#define SENSOR_TYPE_POSE_6DOF                         (28)
 #define SENSOR_STRING_TYPE_POSE_6DOF                  "android.sensor.pose_6dof"
-
-/*
- * SENSOR_TYPE_STATIONARY_DETECT
- * trigger mode: one shot
- *
- * A sensor of this type returns an event if the device is still/stationary for
- * a while. The period of time to monitor for statinarity should be greater than
- * 5 seconds, and less than 10 seconds.
- *
- * Stationarity here refers to absolute stationarity. eg: device on desk.
- *
- * The only allowed value to return is 1.0.
- */
-#define SENSOR_TYPE_STATIONARY_DETECT                   (29)
 #define SENSOR_STRING_TYPE_STATIONARY_DETECT            "android.sensor.stationary_detect"
-
-/*
- * SENSOR_TYPE_MOTION_DETECT
- * trigger mode: one shot
- *
- * A sensor of this type returns an event if the device is not still for
- * a while. The period of time to monitor for statinarity should be greater than
- * 5 seconds, and less than 10 seconds.
- *
- * Motion here refers to any mechanism in which the device is causes to be
- * moved in its inertial frame. eg: Pickin up the device and walking with it
- * to a nearby room may trigger motion wherewas keeping the device on a table
- * on a smooth train moving at constant velocity may not trigger motion.
- *
- * The only allowed value to return is 1.0.
- */
-#define SENSOR_TYPE_MOTION_DETECT                       (30)
 #define SENSOR_STRING_TYPE_MOTION_DETECT                "android.sensor.motion_detect"
-
-/*
- * SENSOR_TYPE_HEART_BEAT
- * trigger mode: continuous
- *
- * A sensor of this type returns an event everytime a hear beat peak is
- * detected.
- *
- * Peak here ideally corresponds to the positive peak in the QRS complex of
- * and ECG signal.
- *
- * The sensor is not expected to be optimized for latency. As a guide, a
- * latency of up to 10 seconds is acceptable. However the timestamp attached
- * to the event should be accurate and should correspond to the time the peak
- * occured.
- *
- * The sensor event contains a parameter for the confidence in the detection
- * of the peak where 0.0 represent no information at all, and 1.0 represents
- * certainty.
- */
-#define SENSOR_TYPE_HEART_BEAT                          (31)
 #define SENSOR_STRING_TYPE_HEART_BEAT                   "android.sensor.heart_beat"
-
-/**
- * SENSOR_TYPE_DYNAMIC_SENSOR_META
- * trigger-mode: special
- *
- * A sensor event of this type is received when a dynamic sensor is added to or removed from the
- * system. At most one sensor of this type can be present in one sensor HAL implementation and
- * presence of a sensor of this type in sensor HAL implementation indicates that this sensor HAL
- * supports dynamic sensor feature. Operations, such as batch, activate and setDelay, to this
- * special purpose sensor should be treated as no-op and return successful.
- *
- * A dynamic sensor connection indicates connection of a physical device or instantiation of a
- * virtual sensor backed by algorithm; and a dynamic sensor disconnection indicates the the
- * opposite. A sensor event of SENSOR_TYPE_DYNAMIC_SENSOR_META type should be delivered regardless
- * of the activation status of the sensor in the event of dynamic sensor connection and
- * disconnection. In the sensor event, besides the common data entries, "dynamic_sensor_meta", which
- * includes fields for connection status, handle of the sensor involved, pointer to sensor_t
- * structure and a uuid field, should be populated.
- *
- * At a dynamic sensor connection event, fields of sensor_t structure referenced by a pointer in
- * dynamic_sensor_meta should be filled as if it was regular sensors. Sensor HAL is responsible for
- * recovery of memory if the corresponding data is dynamicially allocated. However, the the pointer
- * must be valid until the first activate call to the sensor reported in this connection event. At a
- * dynamic sensor disconnection, the sensor_t pointer should be NULL.
- *
- * The sensor handle assigned to dynamic sensors should never be the same as that of any regular
- * static sensors, and should be unique until next boot. In another word, if a handle h is used for
- * a dynamic sensor A, that same number cannot be used for the same dynamic sensor A or another
- * dynamic sensor B even after disconnection of A until reboot.
- *
- * The UUID field will be used for identifying the sensor in addition to name, vendor and version
- * and type. For physical sensors of the same model, all sensors will have the same values in
- * sensor_t, but the UUID should be unique and persistent for each individual unit. An all zero UUID
- * indicates it is not possible to differentiate individual sensor unit.
- *
- */
-#define SENSOR_TYPE_DYNAMIC_SENSOR_META                         (32)
 #define SENSOR_STRING_TYPE_DYNAMIC_SENSOR_META                  "android.sensor.dynamic_sensor_meta"
-
-/**
- * SENSOR_TYPE_ADDITIONAL_INFO
- * reporting-mode: N/A
- *
- * This sensor type is for delivering additional sensor information aside from sensor event data.
- * Additional information may include sensor front-end group delay, internal calibration parameters,
- * noise level metrics, device internal temperature, etc.
- *
- * This type will never bind to a sensor. In other words, no sensor in the sensor list should be of
- * the type SENSOR_TYPE_ADDITIONAL_INFO. If a sensor HAL supports sensor additional information
- * feature, it reports sensor_event_t with "sensor" field set to handle of the reporting sensor and
- * "type" field set to SENSOR_TYPE_ADDITIONAL_INFO. Delivery of additional information events is
- * triggered under two conditions: an enable activate() call or a flush() call to the corresponding
- * sensor.
- *
- * A single additional information report consists of multiple frames. Sequences of these frames are
- * ordered using timestamps, which means the timestamps of sequential frames have to be at least 1
- * nanosecond apart from each other. Each frame is a sensor_event_t delivered through the HAL
- * interface, with related data stored in the "additional_info" field, which is of type
- * additional_info_event_t.  The "type" field of additional_info_event_t denotes the nature of the
- * payload data (see additional_info_type_t).  The "serial" field is used to keep the sequence of
- * payload data that spans multiple frames. The first frame of the entire report is always of type
- * AINFO_BEGIN, and the last frame is always AINFO_END.
- *
- * All additional information frames have to be delivered after flush complete event if flush() was
- * triggering the report.
- */
-#define SENSOR_TYPE_ADDITIONAL_INFO                       (33)
 #define SENSOR_STRING_TYPE_ADDITIONAL_INFO                "android.sensor.additional_info"
+#define SENSOR_STRING_TYPE_LOW_LATENCY_OFFBODY_DETECT     "android.sensor.low_latency_offbody"
 
 /**
  * Values returned by the accelerometer in various locations in the universe.
@@ -876,16 +178,6 @@
 /** Minimum magnetic field on Earth's surface */
 #define MAGNETIC_FIELD_EARTH_MIN    (30.0f)
 
-/**
- * Possible values of the status field of sensor events.
- */
-#define SENSOR_STATUS_NO_CONTACT        -1
-#define SENSOR_STATUS_UNRELIABLE        0
-#define SENSOR_STATUS_ACCURACY_LOW      1
-#define SENSOR_STATUS_ACCURACY_MEDIUM   2
-#define SENSOR_STATUS_ACCURACY_HIGH     3
-
-
 struct sensor_t;
 
 /**
@@ -977,75 +269,6 @@
     };
 } additional_info_event_t;
 
-typedef enum additional_info_type {
-    //
-    AINFO_BEGIN = 0x0,                      // Marks the beginning of additional information frames
-    AINFO_END   = 0x1,                      // Marks the end of additional information frames
-    // Basic information
-    AINFO_UNTRACKED_DELAY =  0x10000,       // Estimation of the delay that is not tracked by sensor
-                                            // timestamps. This includes delay introduced by
-                                            // sensor front-end filtering, data transport, etc.
-                                            // float[2]: delay in seconds
-                                            //           standard deviation of estimated value
-                                            //
-    AINFO_INTERNAL_TEMPERATURE,             // float: Celsius temperature.
-                                            //
-    AINFO_VEC3_CALIBRATION,                 // First three rows of a homogeneous matrix, which
-                                            // represents calibration to a three-element vector
-                                            // raw sensor reading.
-                                            // float[12]: 3x4 matrix in row major order
-                                            //
-    AINFO_SENSOR_PLACEMENT,                 // Location and orientation of sensor element in the
-                                            // device frame: origin is the geometric center of the
-                                            // mobile device screen surface; the axis definition
-                                            // corresponds to Android sensor definitions.
-                                            // float[12]: 3x4 matrix in row major order
-                                            //
-    AINFO_SAMPLING,                         // float[2]: raw sample period in seconds,
-                                            //           standard deviation of sampling period
-
-    // Sampling channel modeling information
-    AINFO_CHANNEL_NOISE = 0x20000,          // int32_t: noise type
-                                            // float[n]: parameters
-                                            //
-    AINFO_CHANNEL_SAMPLER,                  // float[3]: sample period
-                                            //           standard deviation of sample period,
-                                            //           quantization unit
-                                            //
-    AINFO_CHANNEL_FILTER,                   // Represents a filter:
-                                            //      \sum_j a_j y[n-j] == \sum_i b_i x[n-i]
-                                            //
-                                            // int32_t[3]: number of feedforward coefficients, M,
-                                            //             number of feedback coefficients, N, for
-                                            //               FIR filter, N=1.
-                                            //             bit mask that represents which element to
-                                            //               which the filter is applied, bit 0 == 1
-                                            //               means this filter applies to vector
-                                            //               element 0.
-                                            // float[M+N]: filter coefficients (b0, b1, ..., BM-1),
-                                            //             then (a0, a1, ..., aN-1), a0 is always 1.
-                                            //             Multiple frames may be needed for higher
-                                            //             number of taps.
-                                            //
-    AINFO_CHANNEL_LINEAR_TRANSFORM,         // int32_t[2]: size in (row, column) ... 1st frame
-                                            // float[n]: matrix element values in row major order.
-                                            //
-    AINFO_CHANNEL_NONLINEAR_MAP,            // int32_t[2]: extrapolate method
-                                            //             interpolate method
-                                            // float[n]: mapping key points in pairs, (in, out)...
-                                            //           (may be used to model saturation)
-                                            //
-    AINFO_CHANNEL_RESAMPLER,                // int32_t:  resample method (0-th order, 1st order...)
-                                            // float[1]: resample ratio (upsampling if < 1.0;
-                                            //           downsampling if > 1.0).
-                                            //
-
-    // Custom information
-    AINFO_CUSTOM_START =    0x10000000,     //
-    // Debugging
-    AINFO_DEBUGGING_START = 0x40000000,     //
-} additional_info_type_t;
-
 /**
  * Union of the various types of sensor data
  * that can be returned.
@@ -1333,7 +556,13 @@
                     int sensor_handle, int64_t sampling_period_ns);
 
             /**
-             * Returns an array of sensor data.
+             * Write an array of sensor_event_t to data. The size of the
+             * available buffer is specified by count. Returns number of
+             * valid sensor_event_t.
+             *
+             * This function should block if there is no sensor event
+             * available when being called. Thus, return value should always be
+             * positive.
              */
             int (*poll)(struct sensors_poll_device_t *dev,
                     sensors_event_t* data, int count);
diff --git a/include/hardware/vehicle.h b/include/hardware/vehicle.h
index a590fbd..35ad493 100644
--- a/include/hardware/vehicle.h
+++ b/include/hardware/vehicle.h
@@ -122,7 +122,7 @@
  * @data_member info_model_year
  * @unit VEHICLE_UNIT_TYPE_YEAR
  */
-#define VEHICLE_PROPERTY_INFO_MODEL_YEAR                           (0x00000103)
+#define VEHICLE_PROPERTY_INFO_MODEL_YEAR                            (0x00000103)
 
 /**
  * Fuel capacity of the vehicle
@@ -253,7 +253,7 @@
 
 
 
- //==== HVAC Properties ====
+//==== HVAC Properties ====
 
 /**
  * Fan speed setting
@@ -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)
@@ -293,7 +292,7 @@
 /**
  * HVAC current temperature.
  * @value_type VEHICLE_VALUE_TYPE_ZONED_FLOAT
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
  * @access VEHICLE_PROP_ACCESS_READ_WRITE
  * @zone_type VEHICLE_ZONE
  * @data_member hvac.temperature_current
@@ -303,7 +302,7 @@
 /**
  * HVAC, target temperature set.
  * @value_type VEHICLE_VALUE_TYPE_ZONED_FLOAT
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
  * @access VEHICLE_PROP_ACCESS_READ_WRITE
  * @zone_type VEHICLE_ZONE
  * @data_member hvac.temperature_set
@@ -373,6 +372,88 @@
 #define VEHICLE_PROPERTY_HVAC_DUAL_ON                               (0x00000509)
 
 /**
+ * On/off automatic mode
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_ZONE
+ * @data_member hvac.auto_on
+ */
+#define VEHICLE_PROPERTY_HVAC_AUTO_ON                               (0x0000050A)
+
+/**
+ * Seat temperature
+ *
+ * Negative values indicate cooling.
+ * 0 indicates off.
+ * Positive values indicate heating.
+ *
+ * Some vehicles may have multiple levels of heating and cooling. The min/max
+ * range defines the allowable range and number of steps in each direction.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @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.
@@ -389,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
@@ -396,8 +496,7 @@
  * @data_member outside_temperature
  * @unit VEHICLE_UNIT_TYPE_CELCIUS
  */
-
-#define VEHICLE_PROPERTY_ENV_OUTSIDE_TEMPERATURE                   (0x00000703)
+#define VEHICLE_PROPERTY_ENV_OUTSIDE_TEMPERATURE                    (0x00000703)
 
 
 /**
@@ -408,7 +507,7 @@
  * @data_member cabin_temperature
  * @unit VEHICLE_UNIT_TYPE_CELCIUS
  */
-#define VEHICLE_PROPERTY_ENV_CABIN_TEMPERATURE                  (0x00000704)
+#define VEHICLE_PROPERTY_ENV_CABIN_TEMPERATURE                      (0x00000704)
 
 
 /*
@@ -434,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.
@@ -492,7 +591,13 @@
  *                       VEHICLE_AUDIO_EXT_FOCUS_CAR_PERMANENT when car side is playing something
  *                       permanent.
  *                   LOSS_TRANSIENT: always should be VEHICLE_AUDIO_EXT_FOCUS_CAR_TRANSIENT
- *   int32_array[3]: should be zero.
+ *   int32_array[3]: context requested by android side when responding to focus request.
+ *                   When car side is taking focus away, this should be zero.
+ *
+ * A focus response should be sent per each focus request even if there is no change in
+ * focus state. This can happen in case like focus request only involving context change
+ * where android side still needs matching focus response to confirm that audio module
+ * has made necessary changes.
  *
  * If car does not support VEHICLE_PROPERTY_AUDIO_FOCUS, focus is assumed to be granted always.
  *
@@ -501,7 +606,7 @@
  * @access VEHICLE_PROP_ACCESS_READ_WRITE
  * @data_member int32_array
  */
-#define VEHICLE_PROPERTY_AUDIO_FOCUS                                  (0x00000900)
+#define VEHICLE_PROPERTY_AUDIO_FOCUS                                (0x00000900)
 
 enum vehicle_audio_focus_request {
     VEHICLE_AUDIO_FOCUS_REQUEST_GAIN = 0x1,
@@ -638,13 +743,23 @@
     VEHICLE_AUDIO_CONTEXT_SYSTEM_SOUND_FLAG               = 0x400,
     /** Radio is played */
     VEHICLE_AUDIO_CONTEXT_RADIO_FLAG                      = 0x800,
+    /** Ext source is played. This is for tagging generic ext sources. */
+    VEHICLE_AUDIO_CONTEXT_EXT_SOURCE_FLAG                 = 0x1000,
 };
 
 /**
  * Property to control audio volume of each audio context.
  *
+ * vehicle_prop_config_t
+ *   config_array[0] : bit flags of all supported audio contexts. If this is 0,
+ *                     audio volume is controlled per physical stream
+ *   config_array[1] : flags defined in vehicle_audio_volume_capability_flag to
+ *                     represent audio module's capability.
+ *
  * Data type looks like:
- *   int32_array[0] : stream context as defined in vehicle_audio_context_flag.
+ *   int32_array[0] : stream context as defined in vehicle_audio_context_flag. If only physical
+                      stream is supported (config_array[0] == 0), this will represent physical
+                      stream number.
  *   int32_array[1] : volume level, valid range is 0 to int32_max_value defined in config.
  *                    0 will be mute state. int32_min_value in config should be always 0.
  *   int32_array[2] : One of vehicle_audio_volume_state.
@@ -658,7 +773,34 @@
  * @config_flags all audio contexts supported.
  * @data_member int32_array
  */
-#define VEHICLE_PROPERTY_AUDIO_VOLUME                                 (0x00000901)
+#define VEHICLE_PROPERTY_AUDIO_VOLUME                               (0x00000901)
+
+
+/**
+ * flags to represent capability of audio volume property.
+ * used in config_array[1] of vehicle_prop_config_t.
+ */
+enum vehicle_audio_volume_capability_flag {
+    /**
+     * External audio module or vehicle hal has persistent storage
+     * to keep the volume level. This should be set only when per context
+     * volume level is supproted. When this is set, audio volume level per
+     * each context will be retrieved from the property when systen starts up.
+     * And external audio module is also expected to adjust volume automatically
+     * whenever there is an audio context change.
+     * When this flag is not set, android side will assume that there is no
+     * persistent storage and stored value in android side will be used to
+     * initialize the volume level. And android side will set volume level
+     * of each physical streams whenever there is an audio context change.
+     */
+    VEHICLE_AUDIO_VOLUME_CAPABILITY_PERSISTENT_STORAGE = 0x1,
+    /**
+     * When this flag is set, the H/W can support only single master volume for all streams.
+     * There is no way to set volume level differently per each stream or context.
+     */
+    VEHICLE_AUDIO_VOLUME_CAPABILITY_MASTER_VOLUME_ONLY = 0x2,
+};
+
 
 /**
  * enum to represent audio volume state.
@@ -683,8 +825,18 @@
 
 /**
  * Property for handling volume limit set by user. This limits maximum volume that can be set
- * per each context.
- *   int32_array[0] : stream context as defined in vehicle_audio_context_flag.
+ * per each context or physical stream.
+ *
+ * vehicle_prop_config_t
+ *   config_array[0] : bit flags of all supported audio contexts. If this is 0,
+ *                     audio volume is controlled per physical stream
+ *   config_array[1] : flags defined in vehicle_audio_volume_capability_flag to
+ *                     represent audio module's capability.
+ *
+ * Data type looks like:
+ *   int32_array[0] : stream context as defined in vehicle_audio_context_flag. If only physical
+ *                    stream is supported (config_array[0] == 0), this will represent physical
+ *                    stream number.
  *   int32_array[1] : maximum volume set to the stream. If there is no restriction, this value
  *                    will be  bigger than VEHICLE_PROPERTY_AUDIO_VOLUME's max value.
  *
@@ -698,7 +850,7 @@
  * @config_flags all audio contexts supported.
  * @data_member int32_array
  */
-#define VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT                           (0x00000902)
+#define VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT                         (0x00000902)
 
 /**
  * Index in int32_array for VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT property.
@@ -727,7 +879,7 @@
  * @access VEHICLE_PROP_ACCESS_WRITE
  * @data_member int32_array
  */
-#define VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY                         (0x00000903)
+#define VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY                       (0x00000903)
 
 /**
  * Index in int32_array for VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY property.
@@ -750,7 +902,7 @@
 *               this.
 * @data_member int32_value
 */
-#define VEHICLE_PROPERTY_AUDIO_HW_VARIANT                             (0x00000904)
+#define VEHICLE_PROPERTY_AUDIO_HW_VARIANT                           (0x00000904)
 
 /**
  * Flag to be used in vehicle_prop_config.config_flags for VEHICLE_PROPERTY_AUDIO_HW_VARIANT.
@@ -766,6 +918,70 @@
     VEHICLE_AUDIO_HW_VARIANT_FLAG_INTERNAL_RADIO_FLAG = 0x1,
 };
 
+/** audio routing for AM/FM. This should be also be the value when there is only one
+    radio module in the system. */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_AM_FM "RADIO_AM_FM"
+/** Should be added only when there is a separate radio module with HD capability. */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_AM_FM_HD "RADIO_AM_FM_HD"
+/** For digial audio broadcasting type of radio */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_DAB "RADIO_DAB"
+/** For satellite type of radio */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_SATELLITE "RADIO_SATELLITE"
+/** For CD or DVD */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_CD_DVD "CD_DVD"
+/** For 1st auxiliary input */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_AUX_IN0 "AUX_IN0"
+/** For 2nd auxiliary input */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_AUX_IN1 "AUX_IN1"
+/** For navigation guidance from outside android */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_NAV_GUIDANCE "EXT_NAV_GUIDANCE"
+/** For voice command from outside android */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_VOICE_COMMAND "EXT_VOICE_COMMAND"
+/** For voice call from outside android */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_VOICE_CALL "EXT_VOICE_CALL"
+/** For safety alert from outside android */
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_SAFETY_ALERT "EXT_SAFETY_ALERT"
+
+/**
+* Property to pass hint on external audio routing. When android side request focus
+* with VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG flag, this property will be set
+* before setting AUDIO_FOCUS property as a hint for external audio source routing.
+* Note that setting this property alone should not trigger any change.
+* Audio routing should be changed only when AUDIO_FOCUS property is set. Note that
+* this property allows passing custom value as long as it is defined in config_string.
+* This allows supporting non-standard routing options through this property.
+* It is recommended to use separate name space for custom property to prevent conflict in future
+* android releases.
+* Enabling each external routing option is done by enabling each bit flag for the routing.
+* This property can support up to 128 external routings.
+* To give full flexibility, there is no standard definition for each bit flag and
+* assigning each big flag to specific routing type is decided by config_string.
+* config_string has format of each entry separated by ','
+* and each entry has format of bitFlagPositon:typeString[:physicalStreamNumber].
+*  bitFlagPosition: represents which big flag will be set to enable this routing. 0 means
+*    LSB in int32_array[0]. 31 will be MSB in int32_array[0]. 127 will MSB in int32_array[3].
+*  typeString: string representation of external routing. Some types are already defined
+*    in VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_* and use them first before adding something
+*    custom. Applications will find each routing using this string.
+*  physicalStreamNumber: This part is optional and represents physical stream to android
+*    which will be disabled when this routing is enabled. If not specified, this routing
+*    should not affect physical streams to android.
+* As an example, let's assume a system with two physical streams, 0 for media and 1 for
+* nav guidance. And let's assume external routing option of am fm radio, external navigation
+* guidance, satellite radio, and one custom. Let's assume that radio and satellite replaces
+* physical stream 0 and external navigation replaces physical stream 1. And bit flag will be
+* assigned in the order listed above. This configuration will look like this in config_string:
+*  "0:RADIO_AM_FM:0,1:EXT_NAV_GUIDANCE:1,2:RADIO_SATELLITE:0,3:com.test.SOMETHING_CUSTOM"
+* When android requests RADIO_AM_FM, int32_array[0] will be set to 0x1.
+* When android requests RADIO_SATELLITE + EXT_NAV_GUIDANCE, int32_array[0] will be set to 0x2|0x4.
+*
+* @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
+* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+* @access VEHICLE_PROP_ACCESS_WRITE|VEHICLE_PROP_ACCESS_READ_WRITE
+* @config_string List of all avaiable external source in the system.
+* @data_member int32_array
+*/
+#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_HINT                     (0x00000905)
 
 /**
  * Property to control power state of application processor.
@@ -788,7 +1004,7 @@
  * @config_flags Additional info on power state. Should use vehicle_ap_power_state_config_flag.
  * @data_member int32_array
  */
-#define VEHICLE_PROPERTY_AP_POWER_STATE                               (0x00000A00)
+#define VEHICLE_PROPERTY_AP_POWER_STATE                             (0x00000A00)
 
 enum vehicle_ap_power_state_config_flag {
     /**
@@ -895,7 +1111,7 @@
  * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_READ_WRITE
  * @data_member int32
  */
-#define VEHICLE_PROPERTY_DISPLAY_BRIGHTNESS                        (0x00000A01)
+#define VEHICLE_PROPERTY_DISPLAY_BRIGHTNESS                         (0x00000A01)
 
 
 /**
@@ -999,7 +1215,7 @@
  * @config_array 0:vehicle_instument_cluster_type 1:hw type
  * @data_member int32_array
  */
-#define VEHICLE_PROPERTY_INSTRUMENT_CLUSTER_INFO                     (0x00000A20)
+#define VEHICLE_PROPERTY_INSTRUMENT_CLUSTER_INFO                    (0x00000A20)
 
 /**
  * Represents instrument cluster type available in system
@@ -1019,6 +1235,624 @@
 };
 
 /**
+ * Current date and time, encoded as Unix time.
+ * This value denotes the number of seconds that have elapsed since 1/1/1970.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_INT64
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_SET
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member int64_value
+ * @unit VEHICLE_UNIT_TYPE_SECS
+ */
+#define VEHICLE_PROPERTY_UNIX_TIME                                  (0x00000A30)
+
+/**
+ * Current time only.
+ * Some vehicles may not keep track of date.  This property only affects the current time, in
+ * seconds during the day.  Thus, the max value for this parameter is 86,400 (24 * 60 * 60)
+ *
+ * @value_type VEHICLE_VALUE_TYPE_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_SET
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member int32_value
+ * @unit VEHICLE_UNIT_TYPE_SECS
+ */
+#define VEHICLE_PROPERTY_CURRENT_TIME_IN_SECONDS                    (0x00000A31)
+
+
+//==== Car Cabin Properties ====
+/**
+ * Most Car Cabin properties have both a MOVE and POSITION parameter associated with them.
+ *
+ * The MOVE parameter will start moving the device in the indicated direction.  The magnitude
+ * indicates the relative speed.  For instance, setting the WINDOW_MOVE parameter to +1 will roll
+ * the window up.  Setting it to +2 (if available) will roll it up faster.
+ *
+ * The POSITION parameter will move the device to the desired position.  For instance, if the
+ * WINDOW_POS has a range of 0-100, then setting this parameter to 50 will open the window halfway.
+ * Depending upon the initial position, the window may move up or down to the 50% value.
+ *
+ * OEMs may choose to implement one or both of the MOVE/POSITION parameters depending upon the
+ * capability of the hardware.
+ */
+
+// Doors
+/**
+ * Door position
+ *
+ * This is an integer in case a door may be set to a particular position.  Max
+ * value indicates fully open, min value (0) indicates fully closed.
+ *
+ * Some vehicles (minivans) can open the door electronically.  Hence, the ability
+ * to write this property.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_DOOR
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_DOOR_POS                                   (0x00000B00)
+
+/**
+ * Door move
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_DOOR
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_DOOR_MOVE                                  (0x00000B01)
+
+
+/**
+ * Door lock
+ *
+ * 'true' indicates door is locked
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_DOOR
+ * @data_member boolean_value
+ */
+#define VEHICLE_PROPERTY_DOOR_LOCK                                  (0x00000B02)
+
+// Mirrors
+/**
+ * Mirror Z Position
+ *
+ * Positive value indicates tilt upwards, negative value is downwards
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_MIRROR
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_MIRROR_Z_POS                               (0x00000B40)
+
+/**
+ * Mirror Z Move
+ *
+ * Positive value indicates tilt upwards, negative value is downwards
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_MIRROR
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_MIRROR_Z_MOVE                              (0x00000B41)
+
+/**
+ * Mirror Y Position
+ *
+ * Positive value indicate tilt right, negative value is left
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_MIRROR
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_MIRROR_Y_POS                               (0x00000B42)
+
+/**
+ * Mirror Y Move
+ *
+ * Positive value indicate tilt right, negative value is left
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_MIRROR
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_MIRROR_Y_MOVE                              (0x00000B43)
+
+/**
+ * Mirror Lock
+ *
+ * True indicates mirror positions are locked and not changeable
+ *
+ * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member boolean_value
+ */
+#define VEHICLE_PROPERTY_MIRROR_LOCK                                (0x00000B44)
+
+/**
+ * Mirror Fold
+ *
+ * True indicates mirrors are folded
+ *
+ * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member boolean_value
+ */
+#define VEHICLE_PROPERTY_MIRROR_FOLD                                (0x00000B45)
+
+// Seats
+/**
+ * Seat memory select
+ *
+ * This parameter selects the memory preset to use to select the seat position.
+ * The minValue is always 0, and the maxValue determines the number of seat
+ * positions available.
+ *
+ * For instance, if the driver's seat has 3 memory presets, the maxValue will be 3.
+ * When the user wants to select a preset, the desired preset number (1, 2, or 3)
+ * is set.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_MEMORY_SELECT                         (0x00000B80)
+
+/**
+ * Seat memory set
+ *
+ * This setting allows the user to save the current seat position settings into
+ * the selected preset slot.  The maxValue for each seat position shall match
+ * the maxValue for VEHICLE_PROPERTY_SEAT_MEMORY_SELECT.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_MEMORY_SET                            (0x00000B81)
+
+/**
+ * Seatbelt buckled
+ *
+ * True indicates belt is buckled.
+ *
+ * Write access indicates automatic seat buckling capabilities.  There are no known cars at this
+ * time, but you never know...
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member boolean_value
+ */
+#define VEHICLE_PROPERTY_SEAT_BELT_BUCKLED                          (0x00000B82)
+
+/**
+ * Seatbelt height position
+ *
+ * Adjusts the shoulder belt anchor point.
+ * Max value indicates highest position
+ * Min value indicates lowest position
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_BELT_HEIGHT_POS                       (0x00000B83)
+
+/**
+ * Seatbelt height move
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_BELT_HEIGHT_MOVE                      (0x00000B84)
+
+/**
+ * Seat fore/aft position
+ *
+ * Sets the seat position forward (closer to steering wheel) and backwards.
+ * Max value indicates closest to wheel, min value indicates most rearward
+ * position.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_FORE_AFT_POS                          (0x00000B85)
+
+/**
+ * Seat fore/aft move
+ *
+ * Moves the seat position forward and aft.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_FORE_AFT_MOVE                         (0x00000B86)
+
+/**
+ * Seat backrest angle 1 position
+ *
+ * Backrest angle 1 is the actuator closest to the bottom of the seat.
+ * Max value indicates angling forward towards the steering wheel.
+ * Min value indicates full recline.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_1_POS                  (0x00000B87)
+
+/**
+ * Seat backrest angle 1 move
+ *
+ * Moves the backrest forward or recline.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_1_MOVE                 (0x00000B88)
+
+/**
+ * Seat backrest angle 2 position
+ *
+ * Backrest angle 2 is the next actuator up from the bottom of the seat.
+ * Max value indicates angling forward towards the steering wheel.
+ * Min value indicates full recline.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_2_POS                  (0x00000B89)
+
+/**
+ * Seat backrest angle 2 move
+ *
+ * Moves the backrest forward or recline.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_2_MOVE                 (0x00000B8A)
+
+/**
+ * Seat height position
+ *
+ * Sets the seat height.
+ * Max value indicates highest position.
+ * Min value indicates lowest position.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_HEIGHT_POS                            (0x00000B8B)
+
+/**
+ * Seat height move
+ *
+ * Moves the seat height.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_HEIGHT_MOVE                           (0x00000B8C)
+
+/**
+ * Seat depth position
+ *
+ * Sets the seat depth, distance from back rest to front edge of seat.
+ * Max value indicates longest depth position.
+ * Min value indicates shortest position.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_DEPTH_POS                             (0x00000B8D)
+
+/**
+ * Seat depth move
+ *
+ * Adjusts the seat depth.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_DEPTH_MOVE                            (0x00000B8E)
+
+/**
+ * Seat tilt position
+ *
+ * Sets the seat tilt.
+ * Max value indicates front edge of seat higher than back edge.
+ * Min value indicates front edge of seat lower than back edge.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_TILT_POS                              (0x00000B8F)
+
+/**
+ * Seat tilt move
+ *
+ * Tilts the seat.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_TILT_MOVE                             (0x00000B90)
+
+/**
+ * Lumber fore/aft position
+ *
+ * Pushes the lumbar support forward and backwards
+ * Max value indicates most forward position.
+ * Min value indicates most rearward position.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_LUMBAR_FORE_AFT_POS                   (0x00000B91)
+
+/**
+ * Lumbar fore/aft move
+ *
+ * Adjusts the lumbar support.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_LUMBAR_FORE_AFT_MOVE                  (0x00000B92)
+
+/**
+ * Lumbar side support position
+ *
+ * Sets the amount of lateral lumbar support.
+ * Max value indicates widest lumbar setting (i.e. least support)
+ * Min value indicates thinnest lumbar setting.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_LUMBAR_SIDE_SUPPORT_POS               (0x00000B93)
+
+/**
+ * Lumbar side support move
+ *
+ * Adjusts the amount of lateral lumbar support.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_LUMBAR_SIDE_SUPPORT_MOVE              (0x00000B94)
+
+/**
+ * Headrest height position
+ *
+ * Sets the headrest height.
+ * Max value indicates tallest setting.
+ * Min value indicates shortest setting.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_POS                   (0x00000B95)
+
+/**
+ * Headrest height move
+ *
+ * Moves the headrest up and down.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_MOVE                  (0x00000B96)
+
+/**
+ * Headrest angle position
+ *
+ * Sets the angle of the headrest.
+ * Max value indicates most upright angle.
+ * Min value indicates shallowest headrest angle.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_HEADREST_ANGLE_POS                    (0x00000B97)
+
+/**
+ * Headrest angle move
+ *
+ * Adjusts the angle of the headrest
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#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
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#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
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @zone_type VEHICLE_SEAT
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_SEAT_HEADREST_FORE_AFT_MOVE                (0x00000B9A)
+
+
+// Windows
+/**
+ * Window Position
+ *
+ * Max = window up / closed
+ * Min = window down / open
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_WINDOW_POS                                 (0x00000BC0)
+
+/**
+ * Window Move
+ *
+ * Max = window up / closed
+ * Min = window down / open
+ * Magnitude denotes relative speed.  I.e. +2 is faster than +1 in raising the window.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_WINDOW_MOVE                                (0x00000BC1)
+
+/**
+ * Window Vent Position
+ *
+ * This feature is used to control the vent feature on a sunroof.
+ *
+ * Max = vent open
+ * Min = vent closed
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_WINDOW_VENT_POS                            (0x00000BC2)
+
+/**
+ * Window Vent Move
+ *
+ * This feature is used to control the vent feature on a sunroof.
+ *
+ * Max = vent open
+ * Min = vent closed
+ *
+ * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
+ * @data_member int32_value
+ */
+#define VEHICLE_PROPERTY_WINDOW_VENT_MOVE                           (0x00000BC3)
+
+/**
+ * Window Lock
+ *
+ * True indicates windows are locked and can't be moved.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @data_member boolean_value
+ */
+#define VEHICLE_PROPERTY_WINDOW_LOCK                                (0x00000BC4)
+
+
+
+/**
  *  H/W specific, non-standard property can be added as necessary. Such property should use
  *  property number in range of [VEHICLE_PROPERTY_CUSTOM_START, VEHICLE_PROPERTY_CUSTOM_END].
  *  Definition of property in this range is completely up to each HAL implementation.
@@ -1027,20 +1861,20 @@
  *  include config_string of "com.XYZ.some_further_details".
  *  @range_start
  */
-#define VEHICLE_PROPERTY_CUSTOM_START                       (0x70000000)
+#define VEHICLE_PROPERTY_CUSTOM_START                               (0x70000000)
 /** @range_end */
-#define VEHICLE_PROPERTY_CUSTOM_END                         (0x73ffffff)
+#define VEHICLE_PROPERTY_CUSTOM_END                                 (0x73ffffff)
 
 /**
  * Property range allocated for system's internal usage like testing. HAL should never declare
  * property in this range.
  * @range_start
  */
-#define VEHICLE_PROPERTY_INTERNAL_START                     (0x74000000)
+#define VEHICLE_PROPERTY_INTERNAL_START                             (0x74000000)
 /**
  * @range_end
  */
-#define VEHICLE_PROPERTY_INTERNAL_END                       (0x74ffffff)
+#define VEHICLE_PROPERTY_INTERNAL_END                               (0x74ffffff)
 
 /**
  * Value types for various properties.
@@ -1086,12 +1920,14 @@
     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
     VEHICLE_UNIT_TYPE_NANO_SECS             = 0x00000050,
-    VEHICLE_UNOT_TYPE_SECS                  = 0x00000053,
+    VEHICLE_UNIT_TYPE_SECS                  = 0x00000053,
     VEHICLE_UNIT_TYPE_YEAR                  = 0x00000059,
 };
 
@@ -1105,8 +1941,12 @@
      */
     VEHICLE_PROP_CHANGE_MODE_STATIC         = 0x00,
     /**
-     * Property of this type will be reported when there is a change. get should return the
-     * current value.
+     * Property of this type will be reported when there is a change.
+     * get call should return the current value.
+     * Set operation for this property is assumed to be asynchronous. When the property is read
+     * (get) after set, it may still return old value until underlying H/W backing this property
+     * has actually changed the state. Once state is changed, the property will dispatch changed
+     * value as event.
      */
     VEHICLE_PROP_CHANGE_MODE_ON_CHANGE      = 0x01,
     /**
@@ -1114,6 +1954,18 @@
      * the data.
      */
     VEHICLE_PROP_CHANGE_MODE_CONTINUOUS     = 0x02,
+    /**
+     * Property of this type may be polled to get the current value.
+     */
+    VEHICLE_PROP_CHANGE_MODE_POLL           = 0x03,
+    /**
+     * This is for property where change event should be sent only when the value is
+     * set from external component. Normal value change will not trigger event.
+     * For example, clock property can send change event only when it is set, outside android,
+     * for case like user setting time or time getting update. There is no need to send it
+     * per every value change.
+     */
+    VEHICLE_PROP_CHANGE_MODE_ON_SET         = 0x04,
 };
 
 /**
@@ -1238,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
 };
 
 /**
@@ -1468,6 +2318,7 @@
         vehicle_boolean_t max_defrost_on;
         vehicle_boolean_t recirc_on;
         vehicle_boolean_t dual_on;
+        vehicle_boolean_t auto_on;
         vehicle_boolean_t power_on;
 
         float temperature_current;
diff --git a/modules/audio/Android.bp b/modules/audio/Android.bp
index 02da2b3..69e99f9 100644
--- a/modules/audio/Android.bp
+++ b/modules/audio/Android.bp
@@ -26,7 +26,7 @@
         "liblog",
         "libcutils",
     ],
-    cflags: ["-Wno-unused-parameter"],
+    cflags: ["-Wall", "-Werror", "-Wno-unused-parameter"],
 }
 
 // The stub audio HAL module, identical to the default audio hal, but with
@@ -43,7 +43,7 @@
         "liblog",
         "libcutils",
     ],
-    cflags: ["-Wno-unused-parameter"],
+    cflags: ["-Wall", "-Werror", "-Wno-unused-parameter"],
 }
 
 // The stub audio policy HAL module that can be used as a skeleton for
@@ -56,5 +56,5 @@
         "liblog",
         "libcutils",
     ],
-    cflags: ["-Wno-unused-parameter"],
+    cflags: ["-Wall", "-Werror", "-Wno-unused-parameter"],
 }
diff --git a/modules/audio/audio_hw.c b/modules/audio/audio_hw.c
index 35901e4..55a5c3b 100644
--- a/modules/audio/audio_hw.c
+++ b/modules/audio/audio_hw.c
@@ -297,11 +297,9 @@
 {
     ALOGV("adev_open_output_stream...");
 
-    struct stub_audio_device *ladev = (struct stub_audio_device *)dev;
-    struct stub_stream_out *out;
-    int ret;
-
-    out = (struct stub_stream_out *)calloc(1, sizeof(struct stub_stream_out));
+    *stream_out = NULL;
+    struct stub_stream_out *out =
+            (struct stub_stream_out *)calloc(1, sizeof(struct stub_stream_out));
     if (!out)
         return -ENOMEM;
 
@@ -325,11 +323,6 @@
 
     *stream_out = &out->stream;
     return 0;
-
-err_open:
-    free(out);
-    *stream_out = NULL;
-    return ret;
 }
 
 static void adev_close_output_stream(struct audio_hw_device *dev,
@@ -424,11 +417,8 @@
 {
     ALOGV("adev_open_input_stream...");
 
-    struct stub_audio_device *ladev = (struct stub_audio_device *)dev;
-    struct stub_stream_in *in;
-    int ret;
-
-    in = (struct stub_stream_in *)calloc(1, sizeof(struct stub_stream_in));
+    *stream_in = NULL;
+    struct stub_stream_in *in = (struct stub_stream_in *)calloc(1, sizeof(struct stub_stream_in));
     if (!in)
         return -ENOMEM;
 
@@ -450,11 +440,6 @@
 
     *stream_in = &in->stream;
     return 0;
-
-err_open:
-    free(in);
-    *stream_in = NULL;
-    return ret;
 }
 
 static void adev_close_input_stream(struct audio_hw_device *dev,
@@ -483,7 +468,6 @@
     ALOGV("adev_open: %s", name);
 
     struct stub_audio_device *adev;
-    int ret;
 
     if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0)
         return -EINVAL;
diff --git a/modules/audio/audio_policy.c b/modules/audio/audio_policy.c
index 9335654..4f9cd5a 100644
--- a/modules/audio/audio_policy.c
+++ b/modules/audio/audio_policy.c
@@ -241,9 +241,7 @@
                              void *service,
                              struct audio_policy **ap)
 {
-    struct default_ap_device *dev;
     struct default_audio_policy *dap;
-    int ret;
 
     *ap = NULL;
 
diff --git a/modules/camera/3_0/Android.mk b/modules/camera/3_0/Android.mk
new file mode 100644
index 0000000..ae68ed5
--- /dev/null
+++ b/modules/camera/3_0/Android.mk
@@ -0,0 +1,45 @@
+# Copyright (C) 2012 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := camera.default
+LOCAL_MODULE_RELATIVE_PATH := hw
+
+LOCAL_C_INCLUDES += \
+	system/core/include \
+	system/media/camera/include \
+
+LOCAL_SRC_FILES := \
+	CameraHAL.cpp \
+	Camera.cpp \
+	ExampleCamera.cpp \
+	Metadata.cpp \
+	Stream.cpp \
+	VendorTags.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+	libcamera_metadata \
+	libcutils \
+	liblog \
+	libsync \
+	libutils \
+
+LOCAL_CFLAGS += -Wall -Wextra -fvisibility=hidden
+
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/modules/camera/Camera.cpp b/modules/camera/3_0/Camera.cpp
similarity index 100%
rename from modules/camera/Camera.cpp
rename to modules/camera/3_0/Camera.cpp
diff --git a/modules/camera/Camera.h b/modules/camera/3_0/Camera.h
similarity index 100%
rename from modules/camera/Camera.h
rename to modules/camera/3_0/Camera.h
diff --git a/modules/camera/CameraHAL.cpp b/modules/camera/3_0/CameraHAL.cpp
similarity index 100%
rename from modules/camera/CameraHAL.cpp
rename to modules/camera/3_0/CameraHAL.cpp
diff --git a/modules/camera/CameraHAL.h b/modules/camera/3_0/CameraHAL.h
similarity index 100%
rename from modules/camera/CameraHAL.h
rename to modules/camera/3_0/CameraHAL.h
diff --git a/modules/camera/ExampleCamera.cpp b/modules/camera/3_0/ExampleCamera.cpp
similarity index 100%
rename from modules/camera/ExampleCamera.cpp
rename to modules/camera/3_0/ExampleCamera.cpp
diff --git a/modules/camera/ExampleCamera.h b/modules/camera/3_0/ExampleCamera.h
similarity index 100%
rename from modules/camera/ExampleCamera.h
rename to modules/camera/3_0/ExampleCamera.h
diff --git a/modules/camera/Metadata.cpp b/modules/camera/3_0/Metadata.cpp
similarity index 100%
rename from modules/camera/Metadata.cpp
rename to modules/camera/3_0/Metadata.cpp
diff --git a/modules/camera/Metadata.h b/modules/camera/3_0/Metadata.h
similarity index 100%
rename from modules/camera/Metadata.h
rename to modules/camera/3_0/Metadata.h
diff --git a/modules/camera/Stream.cpp b/modules/camera/3_0/Stream.cpp
similarity index 100%
rename from modules/camera/Stream.cpp
rename to modules/camera/3_0/Stream.cpp
diff --git a/modules/camera/Stream.h b/modules/camera/3_0/Stream.h
similarity index 100%
rename from modules/camera/Stream.h
rename to modules/camera/3_0/Stream.h
diff --git a/modules/camera/VendorTags.cpp b/modules/camera/3_0/VendorTags.cpp
similarity index 100%
rename from modules/camera/VendorTags.cpp
rename to modules/camera/3_0/VendorTags.cpp
diff --git a/modules/camera/VendorTags.h b/modules/camera/3_0/VendorTags.h
similarity index 100%
rename from modules/camera/VendorTags.h
rename to modules/camera/3_0/VendorTags.h
diff --git a/modules/camera/Android.mk b/modules/camera/Android.mk
index ae68ed5..71388aa 100644
--- a/modules/camera/Android.mk
+++ b/modules/camera/Android.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 The Android Open Source Project
+# Copyright (C) 2016 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -12,34 +12,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := camera.default
-LOCAL_MODULE_RELATIVE_PATH := hw
-
-LOCAL_C_INCLUDES += \
-	system/core/include \
-	system/media/camera/include \
-
-LOCAL_SRC_FILES := \
-	CameraHAL.cpp \
-	Camera.cpp \
-	ExampleCamera.cpp \
-	Metadata.cpp \
-	Stream.cpp \
-	VendorTags.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
-	libcamera_metadata \
-	libcutils \
-	liblog \
-	libsync \
-	libutils \
-
-LOCAL_CFLAGS += -Wall -Wextra -fvisibility=hidden
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
+include $(call all-subdir-makefiles)
diff --git a/modules/hwcomposer/hwcomposer.cpp b/modules/hwcomposer/hwcomposer.cpp
index 9d1aa34..7b2e278 100644
--- a/modules/hwcomposer/hwcomposer.cpp
+++ b/modules/hwcomposer/hwcomposer.cpp
@@ -38,18 +38,18 @@
         struct hw_device_t** device);
 
 static struct hw_module_methods_t hwc_module_methods = {
-    open: hwc_device_open
+    .open = hwc_device_open
 };
 
 hwc_module_t HAL_MODULE_INFO_SYM = {
-    common: {
-        tag: HARDWARE_MODULE_TAG,
-        version_major: 1,
-        version_minor: 0,
-        id: HWC_HARDWARE_MODULE_ID,
-        name: "Sample hwcomposer module",
-        author: "The Android Open Source Project",
-        methods: &hwc_module_methods,
+    .common = {
+        .tag = HARDWARE_MODULE_TAG,
+        .version_major = 1,
+        .version_minor = 0,
+        .id = HWC_HARDWARE_MODULE_ID,
+        .name = "Sample hwcomposer module",
+        .author = "The Android Open Source Project",
+        .methods = &hwc_module_methods,
     }
 };
 
@@ -68,8 +68,8 @@
             l->displayFrame.bottom);
 }
 
-static int hwc_prepare(hwc_composer_device_1_t *dev,
-        size_t numDisplays, hwc_display_contents_1_t** displays) {
+static int hwc_prepare(hwc_composer_device_1_t * /*dev*/,
+        size_t /*numDisplays*/, hwc_display_contents_1_t** displays) {
     if (displays && (displays[0]->flags & HWC_GEOMETRY_CHANGED)) {
         for (size_t i=0 ; i<displays[0]->numHwLayers ; i++) {
             //dump_layer(&list->hwLayers[i]);
@@ -79,16 +79,16 @@
     return 0;
 }
 
-static int hwc_set(hwc_composer_device_1_t *dev,
-        size_t numDisplays, hwc_display_contents_1_t** displays)
+static int hwc_set(hwc_composer_device_1_t * /*dev*/,
+        size_t /*numDisplays*/, hwc_display_contents_1_t** displays)
 {
     //for (size_t i=0 ; i<list->numHwLayers ; i++) {
     //    dump_layer(&list->hwLayers[i]);
     //}
 
-    EGLBoolean sucess = eglSwapBuffers((EGLDisplay)displays[0]->dpy,
+    EGLBoolean success = eglSwapBuffers((EGLDisplay)displays[0]->dpy,
             (EGLSurface)displays[0]->sur);
-    if (!sucess) {
+    if (!success) {
         return HWC_EGL_ERROR;
     }
     return 0;
diff --git a/modules/input/evdev/InputHub.cpp b/modules/input/evdev/InputHub.cpp
index 389955d..e2c65fa 100644
--- a/modules/input/evdev/InputHub.cpp
+++ b/modules/input/evdev/InputHub.cpp
@@ -610,7 +610,7 @@
             for (;;) {
                 ssize_t readSize = TEMP_FAILURE_RETRY(read(inputFd, ievs, sizeof(ievs)));
                 if (readSize == 0 || (readSize < 0 && errno == ENODEV)) {
-                    ALOGW("could not get event, removed? (fd: %d, size: %d errno: %d)",
+                    ALOGW("could not get event, removed? (fd: %d, size: %zd errno: %d)",
                             inputFd, readSize, errno);
 
                     removedDeviceFds.push_back(inputFd);
@@ -621,7 +621,7 @@
                     }
                     break;
                 } else if (readSize % sizeof(input_event) != 0) {
-                    ALOGE("could not get event. wrong size=%d", readSize);
+                    ALOGE("could not get event. wrong size=%zd", readSize);
                     break;
                 } else {
                     size_t count = static_cast<size_t>(readSize) / sizeof(struct input_event);
@@ -702,7 +702,7 @@
             if (event->mask & IN_CREATE) {
                 auto deviceNode = openNode(path);
                 if (deviceNode == nullptr) {
-                    ALOGE("could not open device node %s. err=%d", path.c_str(), res);
+                    ALOGE("could not open device node %s. err=%zd", path.c_str(), res);
                 } else {
                     mInputCallback->onDeviceAdded(deviceNode);
                 }
diff --git a/modules/local_time/local_time_hw.c b/modules/local_time/local_time_hw.c
index ac597f4..899c38a 100644
--- a/modules/local_time/local_time_hw.c
+++ b/modules/local_time/local_time_hw.c
@@ -28,6 +28,9 @@
 #include <hardware/hardware.h>
 #include <hardware/local_time_hal.h>
 
+// We only support gcc and clang, both of which support this attribute.
+#define UNUSED_ARGUMENT __attribute((unused))
+
 struct stub_local_time_device {
     struct local_time_hw_device device;
 };
@@ -51,7 +54,8 @@
     return (int64_t)now;
 }
 
-static uint64_t ltdev_get_local_freq(struct local_time_hw_device* dev)
+static uint64_t ltdev_get_local_freq(
+        struct local_time_hw_device* dev UNUSED_ARGUMENT)
 {
     // For better or worse, linux clock_gettime routines normalize all clock
     // frequencies to 1GHz
diff --git a/modules/nfc-nci/nfc_nci_example.c b/modules/nfc-nci/nfc_nci_example.c
index 758c2b7..ea5eb47 100644
--- a/modules/nfc-nci/nfc_nci_example.c
+++ b/modules/nfc-nci/nfc_nci_example.c
@@ -23,44 +23,61 @@
 
 
 /*
+ * We want to silence the "unused argument" that gcc and clang give.
+ * Other compilers generating this warning will need to provide their
+ * custom attribute to silence this.
+ */
+#if defined(__GNUC__) || defined(__clang__)
+#define UNUSED_ARGUMENT __attribute((unused))
+#else
+#define UNUSED_ARGUMENT
+#endif
+
+/*
  * NCI HAL method implementations. These must be overriden
  */
-static int hal_open(const struct nfc_nci_device *dev,
-        nfc_stack_callback_t *p_cback, nfc_stack_data_callback_t *p_data_cback) {
+static int hal_open(const struct nfc_nci_device *dev UNUSED_ARGUMENT,
+        nfc_stack_callback_t *p_cback UNUSED_ARGUMENT,
+        nfc_stack_data_callback_t *p_data_cback UNUSED_ARGUMENT) {
     ALOGE("NFC-NCI HAL: %s", __FUNCTION__);
     return 0;
 }
 
-static int hal_write(const struct nfc_nci_device *dev,
-        uint16_t data_len, const uint8_t *p_data) {
+static int hal_write(const struct nfc_nci_device *dev UNUSED_ARGUMENT,
+        uint16_t data_len UNUSED_ARGUMENT,
+        const uint8_t *p_data UNUSED_ARGUMENT) {
     ALOGE("NFC-NCI HAL: %s", __FUNCTION__);
     return 0;
 }
 
-static int hal_core_initialized(const struct nfc_nci_device *dev,
-        uint8_t* p_core_init_rsp_params) {
+static int hal_core_initialized(
+        const struct nfc_nci_device *dev UNUSED_ARGUMENT,
+        uint8_t* p_core_init_rsp_params UNUSED_ARGUMENT) {
     ALOGE("NFC-NCI HAL: %s", __FUNCTION__);
     return 0;
 }
 
-static int hal_pre_discover(const struct nfc_nci_device *dev) {
+static int hal_pre_discover(
+        const struct nfc_nci_device *dev UNUSED_ARGUMENT) {
     ALOGE("NFC-NCI HAL: %s", __FUNCTION__);
     return 0;
 }
 
-static int hal_close(const struct nfc_nci_device *dev) {
+static int hal_close(const struct nfc_nci_device *dev UNUSED_ARGUMENT) {
     ALOGE("NFC-NCI HAL: %s", __FUNCTION__);
     return 0;
 }
 
-static int hal_control_granted (const struct nfc_nci_device *p_dev)
+static int hal_control_granted (
+        const struct nfc_nci_device *p_dev UNUSED_ARGUMENT)
 {
     ALOGE("NFC-NCI HAL: %s", __FUNCTION__);
     return 0;
 }
 
 
-static int hal_power_cycle (const struct nfc_nci_device *p_dev)
+static int hal_power_cycle (
+        const struct nfc_nci_device *p_dev UNUSED_ARGUMENT)
 {
     ALOGE("NFC-NCI HAL: %s", __FUNCTION__);
     return 0;
diff --git a/modules/radio/radio_hal_tool.c b/modules/radio/radio_hal_tool.c
index 05d872e..6c40739 100644
--- a/modules/radio/radio_hal_tool.c
+++ b/modules/radio/radio_hal_tool.c
@@ -131,7 +131,7 @@
         radio_metadata_key_t key;
         radio_metadata_type_t type;
         void *value;
-        uint32_t size;
+        size_t size;
 
         radio_metadata_get_at_index(info.metadata, i, &key, &type, &value, &size);
 
diff --git a/modules/radio/radio_hw.c b/modules/radio/radio_hw.c
index fbf8c94..a4db565 100644
--- a/modules/radio/radio_hw.c
+++ b/modules/radio/radio_hw.c
@@ -189,7 +189,7 @@
 exit:
     close(fd);
     free(data);
-    ALOGE_IF(ret != 0, "%s error %d", __func__, ret);
+    ALOGE_IF(ret != 0, "%s error %d", __func__, (int)ret);
     return (int)ret;
 }
 
@@ -209,6 +209,7 @@
     *metadata = NULL;
 
     ret = radio_metadata_allocate(metadata, tuner->program.channel, 0);
+
     if (ret != 0)
         return ret;
 
@@ -220,14 +221,14 @@
         if (ret != 0)
             goto exit;
         ret = add_bitmap_metadata(metadata, RADIO_METADATA_KEY_ICON, BITMAP_FILE_PATH);
-        if (ret != 0)
+        if (ret != 0 && ret != -EPIPE)
             goto exit;
         ret = radio_metadata_add_clock(metadata, RADIO_METADATA_KEY_CLOCK, &hw_clock);
         if (ret != 0)
             goto exit;
     } else {
         ret = add_bitmap_metadata(metadata, RADIO_METADATA_KEY_ART, BITMAP_FILE_PATH);
-        if (ret != 0)
+        if (ret != 0 && ret != -EPIPE)
             goto exit;
     }
 
@@ -418,7 +419,6 @@
                         event.type = RADIO_EVENT_METADATA;
                         event.metadata = metadata;
                     }
-                    send_meta_data = true;
                 } break;
 
                 case CMD_CANCEL: {
diff --git a/modules/sensors/tests/SensorEventQueue_test.cpp b/modules/sensors/tests/SensorEventQueue_test.cpp
index 3218bb9..d3d75ee 100644
--- a/modules/sensors/tests/SensorEventQueue_test.cpp
+++ b/modules/sensors/tests/SensorEventQueue_test.cpp
@@ -32,7 +32,7 @@
     return true;
 }
 
-bool checkInt(char* msg, int expected, int actual) {
+bool checkInt(const char* msg, int expected, int actual) {
     if (actual != expected) {
         printf("%s; expected %d; actual was %d\n", msg, expected, actual);
         return false;
@@ -187,7 +187,7 @@
 }
 
 
-int main(int argc, char **argv) {
+int main(int argc __attribute((unused)), char **argv __attribute((unused))) {
     if (testSimpleWriteSizeCounts() &&
             testWrappingWriteSizeCounts() &&
             testFullQueueIo()) {
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.cpp b/modules/usbcamera/Camera.cpp
index cf62f7f..b396291 100644
--- a/modules/usbcamera/Camera.cpp
+++ b/modules/usbcamera/Camera.cpp
@@ -484,9 +484,9 @@
     // TODO: dump all settings
     dprintf(fd, "Most Recent Settings: (%p)\n", mSettings);
 
-    dprintf(fd, "Number of streams: %d\n", mStreams.size());
+    dprintf(fd, "Number of streams: %zu\n", mStreams.size());
     for (size_t i = 0; i < mStreams.size(); i++) {
-        dprintf(fd, "Stream %d/%d:\n", i, mStreams.size());
+        dprintf(fd, "Stream %zu/%zu:\n", i, mStreams.size());
         mStreams[i]->dump(fd);
     }
 }
diff --git a/modules/usbcamera/CameraHAL.cpp b/modules/usbcamera/CameraHAL.cpp
index 652e937..c54283b 100644
--- a/modules/usbcamera/CameraHAL.cpp
+++ b/modules/usbcamera/CameraHAL.cpp
@@ -65,7 +65,7 @@
 
 int CameraHAL::getNumberOfCameras() {
     android::Mutex::Autolock al(mModuleLock);
-    ALOGV("%s: %d", __func__, mCameras.size());
+    ALOGV("%s: %zu", __func__, mCameras.size());
     return static_cast<int>(mCameras.size());
 }
 
@@ -126,29 +126,29 @@
 }
 
 static hw_module_methods_t gCameraModuleMethods = {
-    open : open_dev
+    .open = open_dev
 };
 
 camera_module_t HAL_MODULE_INFO_SYM __attribute__ ((visibility("default"))) = {
-    common : {
-        tag                : HARDWARE_MODULE_TAG,
-        module_api_version : CAMERA_MODULE_API_VERSION_2_4,
-        hal_api_version    : HARDWARE_HAL_API_VERSION,
-        id                 : CAMERA_HARDWARE_MODULE_ID,
-        name               : "Default USB Camera HAL",
-        author             : "The Android Open Source Project",
-        methods            : &gCameraModuleMethods,
-        dso                : NULL,
-        reserved           : {0},
+    .common = {
+        .tag                = HARDWARE_MODULE_TAG,
+        .module_api_version = CAMERA_MODULE_API_VERSION_2_4,
+        .hal_api_version    = HARDWARE_HAL_API_VERSION,
+        .id                 = CAMERA_HARDWARE_MODULE_ID,
+        .name               = "Default USB Camera HAL",
+        .author             = "The Android Open Source Project",
+        .methods            = &gCameraModuleMethods,
+        .dso                = NULL,
+        .reserved           = {0},
     },
-    get_number_of_cameras : get_number_of_cameras,
-    get_camera_info       : get_camera_info,
-    set_callbacks         : set_callbacks,
-    get_vendor_tag_ops    : NULL,
-    open_legacy           : NULL,
-    set_torch_mode        : NULL,
-    init                  : NULL,
-    reserved              : {0},
+    .get_number_of_cameras = get_number_of_cameras,
+    .get_camera_info       = get_camera_info,
+    .set_callbacks         = set_callbacks,
+    .get_vendor_tag_ops    = NULL,
+    .open_legacy           = NULL,
+    .set_torch_mode        = NULL,
+    .init                  = NULL,
+    .reserved              = {0},
 };
 } // extern "C"
 
diff --git a/modules/usbcamera/HotplugThread.cpp b/modules/usbcamera/HotplugThread.cpp
index 6c65086..02e7167 100644
--- a/modules/usbcamera/HotplugThread.cpp
+++ b/modules/usbcamera/HotplugThread.cpp
@@ -39,6 +39,7 @@
 }
 
 bool HotplugThread::threadLoop() {
+    (void)mModule;  // silence warning about unused member.
 
     /**
      * Check camera connection status change, if connected, do below:
diff --git a/modules/usbcamera/Stream.cpp b/modules/usbcamera/Stream.cpp
index f56866e..2b83421 100644
--- a/modules/usbcamera/Stream.cpp
+++ b/modules/usbcamera/Stream.cpp
@@ -170,10 +170,9 @@
     // ToDo: prettyprint usage mask flags
     dprintf(fd, "Gralloc Usage Mask: %#" PRIx32 "\n", mStream->usage);
     dprintf(fd, "Max Buffer Count: %" PRIu32 "\n", mStream->max_buffers);
-    dprintf(fd, "Number of Buffers in use by HAL: %" PRIu32 "\n", mBuffers.size());
+    dprintf(fd, "Number of Buffers in use by HAL: %zu\n", mBuffers.size());
     for (size_t i = 0; i < mBuffers.size(); i++) {
-        dprintf(fd, "Buffer %" PRIu32 "/%" PRIu32 ": %p\n", i, mBuffers.size(),
-                mBuffers[i]);
+        dprintf(fd, "Buffer %zu/%zu: %p\n", i, mBuffers.size(), mBuffers[i]);
     }
 }
 
diff --git a/modules/usbcamera/UsbCamera.cpp b/modules/usbcamera/UsbCamera.cpp
index d0aaded..9d53fc6 100644
--- a/modules/usbcamera/UsbCamera.cpp
+++ b/modules/usbcamera/UsbCamera.cpp
@@ -313,7 +313,7 @@
     return setTemplate(CAMERA3_TEMPLATE_MANUAL, m.get());
 }
 
-bool UsbCamera::isValidCaptureSettings(const camera_metadata_t* settings) {
+bool UsbCamera::isValidCaptureSettings(const camera_metadata_t* /*settings*/) {
     // TODO: reject settings that cannot be captured
     return true;
 }
diff --git a/modules/vehicle/vehicle.c b/modules/vehicle/vehicle.c
index a26f27c..2d945fd 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);
@@ -331,22 +331,6 @@
         event.prop = sub->prop;
         event.timestamp = elapsedRealtimeNano();
         switch (sub->prop) {
-            case VEHICLE_PROPERTY_DRIVING_STATUS:
-                event.value_type = VEHICLE_VALUE_TYPE_INT32;
-                switch ((event.timestamp & 0x30000000)>>28) {
-                    case 0:
-                        event.value.driving_status = VEHICLE_DRIVING_STATUS_UNRESTRICTED;
-                        break;
-                    case 1:
-                        event.value.driving_status = VEHICLE_DRIVING_STATUS_NO_VIDEO;
-                        break;
-                    case 2:
-                        event.value.driving_status = VEHICLE_DRIVING_STATUS_NO_KEYBOARD_INPUT;
-                        break;
-                    default:
-                        event.value.driving_status = VEHICLE_DRIVING_STATUS_NO_CONFIG;
-                }
-                break;
             case VEHICLE_PROPERTY_GEAR_SELECTION:
                 event.value_type = VEHICLE_VALUE_TYPE_INT32;
                 switch ((event.timestamp & 0x30000000)>>28) {
diff --git a/tests/camera2/CameraModuleFixture.h b/tests/camera2/CameraModuleFixture.h
index 25513af..71d7dd0 100644
--- a/tests/camera2/CameraModuleFixture.h
+++ b/tests/camera2/CameraModuleFixture.h
@@ -74,7 +74,6 @@
     void TearDown() {
         TEST_EXTENSION_FORKING_TEAR_DOWN;
 
-        delete mModule;
         TearDownMixin();
 
         /* important: device must be destructed before closing module,
@@ -85,6 +84,7 @@
             ASSERT_EQ(0, HWModuleHelpers::closeModule(mModule->getDso()))
                 << "Failed to close camera HAL module";
         }
+        delete mModule;
     }
 
     void CreateCamera(int cameraID, /*out*/ sp<CameraDeviceBase> *device) {
diff --git a/tests/hardware/Android.bp b/tests/hardware/Android.bp
deleted file mode 100644
index 668e28f..0000000
--- a/tests/hardware/Android.bp
+++ /dev/null
@@ -1,15 +0,0 @@
-cc_library_static {
-    name: "static-hal-check",
-    srcs: [
-        "struct-size.cpp",
-        "struct-offset.cpp",
-        "struct-last.cpp",
-    ],
-    shared_libs: ["libhardware"],
-    cflags: [
-        "-std=gnu++11",
-        "-O0",
-    ],
-
-    include_dirs: ["system/media/camera/include"],
-}
diff --git a/tests/hardware/Android.mk b/tests/hardware/Android.mk
new file mode 100644
index 0000000..02540c9
--- /dev/null
+++ b/tests/hardware/Android.mk
@@ -0,0 +1,12 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := static-hal-check
+LOCAL_SRC_FILES := struct-size.cpp struct-offset.cpp struct-last.cpp
+LOCAL_SHARED_LIBRARIES := libhardware
+LOCAL_CFLAGS := -std=gnu++11 -O0
+
+LOCAL_C_INCLUDES += \
+    system/media/camera/include
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/tests/vehicle/vehicle-hal-tool.c b/tests/vehicle/vehicle-hal-tool.c
old mode 100755
new mode 100644