Merge "Refactor USB HAL (audio_hw.c)" into lmp-dev
diff --git a/include/hardware/bluetooth.h b/include/hardware/bluetooth.h
index 4d38ff7..7c17b64 100644
--- a/include/hardware/bluetooth.h
+++ b/include/hardware/bluetooth.h
@@ -98,6 +98,15 @@
     uint8_t pin[16];
 } __attribute__((packed))bt_pin_code_t;
 
+typedef struct {
+    uint8_t status;
+    uint8_t ctrl_state;     /* stack reported state */
+    uint64_t tx_time;       /* in ms */
+    uint64_t rx_time;       /* in ms */
+    uint64_t idle_time;     /* in ms */
+    uint64_t energy_used;   /* a product of mA, V and ms */
+} __attribute__((packed))bt_activity_energy_info;
+
 /** Bluetooth Adapter Discovery state */
 typedef enum {
     BT_DISCOVERY_STOPPED,
@@ -140,6 +149,7 @@
     uint8_t max_irk_list_size;
     uint8_t max_adv_filter_supported;
     uint8_t scan_result_storage_size;
+    uint8_t activity_energy_info_supported;
 }bt_local_le_features_t;
 
 /* Bluetooth Adapter and Remote Device property types */
@@ -345,6 +355,15 @@
 * This callback shall be invoked whenever the le_tx_test, le_rx_test or le_test_end is invoked
 * The num_packets is valid only for le_test_end command */
 typedef void (*le_test_mode_callback)(bt_status_t status, uint16_t num_packets);
+
+/** Callback invoked when energy details are obtained */
+/* Ctrl_state-Current controller state-Active-1,scan-2,or idle-3 state as defined by HCI spec.
+ * If the ctrl_state value is 0, it means the API call failed
+ * Time values-In milliseconds as returned by the controller
+ * Energy used-Value as returned by the controller
+ * Status-Provides the status of the read_energy_info API call */
+typedef void (*energy_info_callback)(bt_activity_energy_info *energy_info);
+
 /** TODO: Add callbacks for Link Up/Down and other generic
   *  notifications/callbacks */
 
@@ -364,6 +383,7 @@
     callback_thread_event thread_evt_cb;
     dut_mode_recv_callback dut_mode_recv_cb;
     le_test_mode_callback le_test_mode_cb;
+    energy_info_callback energy_info_cb;
 } bt_callbacks_t;
 
 typedef void (*alarm_cb)(void *data);
@@ -507,6 +527,11 @@
       * This should be called immediately after a successful |init|.
       */
     int (*set_os_callouts)(bt_os_callouts_t *callouts);
+
+    /** Read Energy info details - return value indicates BT_STATUS_SUCCESS or BT_STATUS_NOT_READY
+      * Success indicates that the VSC command was sent to controller
+      */
+    int (*read_energy_info)();
 } bt_interface_t;
 
 /** TODO: Need to add APIs for Service Discovery, Service authorization and
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index 64c51ab..2f72d3a 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -170,10 +170,6 @@
 /** Callback invoked when a scan filter configuration command has completed */
 typedef void (*scan_filter_status_callback)(int enable, int client_if, int status);
 
-/** Track ADV VSE callback invoked when tracked device is found or lost */
-typedef void (*track_adv_event_callback)(int client_if, int filt_index, int addr_type,
-                                             bt_bdaddr_t* bda, int adv_state);
-
 /** Callback invoked when multi-adv enable operation has completed */
 typedef void (*multi_adv_enable_callback)(int client_if, int status);
 
@@ -205,6 +201,9 @@
 /** Callback invoked when batchscan storage threshold limit is crossed */
 typedef void (*batchscan_threshold_callback)(int client_if);
 
+/** Track ADV VSE callback invoked when tracked device is found or lost */
+typedef void (*track_adv_event_callback)(int client_if, int filt_index, int addr_type,
+                                             bt_bdaddr_t* bda, int adv_state);
 
 typedef struct {
     register_client_callback            register_client_cb;
diff --git a/include/hardware/camera_common.h b/include/hardware/camera_common.h
index 0ee929e..322ed93 100644
--- a/include/hardware/camera_common.h
+++ b/include/hardware/camera_common.h
@@ -268,8 +268,29 @@
     /**
      * Common methods of the camera module.  This *must* be the first member of
      * camera_module as users of this structure will cast a hw_module_t to
-     * camera_module pointer in contexts where it's known the hw_module_t references a
-     * camera_module.
+     * camera_module pointer in contexts where it's known the hw_module_t
+     * references a camera_module.
+     *
+     * The return values for common.methods->open for camera_module are:
+     *
+     * 0:           On a successful open of the camera device.
+     *
+     * -ENODEV:     The camera device cannot be opened due to an internal
+     *              error.
+     *
+     * -EINVAL:     The input arguments are invalid, i.e. the id is invalid,
+     *              and/or the module is invalid.
+     *
+     * -EBUSY:      The camera device was already opened for this camera id
+     *              (by using this method or open_legacy),
+     *              regardless of the device HAL version it was opened as.
+     *
+     * -EUSERS:     The maximal number of camera devices that can be
+     *              opened concurrently were opened already, either by
+     *              this method or the open_legacy method.
+     *
+     * All other return values from common.methods->open will be treated as
+     * -ENODEV.
      */
     hw_module_t common;
 
@@ -293,6 +314,15 @@
      * Return the static camera information for a given camera device. This
      * information may not change for a camera device.
      *
+     * Return values:
+     *
+     * 0:           On a successful operation
+     *
+     * -ENODEV:     The information cannot be provided due to an internal
+     *              error.
+     *
+     * -EINVAL:     The input arguments are invalid, i.e. the id is invalid,
+     *              and/or the module is invalid.
      */
     int (*get_camera_info)(int camera_id, struct camera_info *info);
 
@@ -315,6 +345,15 @@
      *
      *    Valid to be called by the framework.
      *
+     * Return values:
+     *
+     * 0:           On a successful operation
+     *
+     * -ENODEV:     The operation cannot be completed due to an internal
+     *              error.
+     *
+     * -EINVAL:     The input arguments are invalid, i.e. the callbacks are
+     *              null
      */
     int (*set_callbacks)(const camera_module_callbacks_t *callbacks);
 
diff --git a/include/hardware/gps.h b/include/hardware/gps.h
index 3cb006b..5747faa 100644
--- a/include/hardware/gps.h
+++ b/include/hardware/gps.h
@@ -224,14 +224,30 @@
 #define GPS_CLOCK_HAS_LEAP_SECOND               (1<<0)
 /** A valid 'time uncertainty' is stored in the data structure. */
 #define GPS_CLOCK_HAS_TIME_UNCERTAINTY          (1<<1)
+/** A valid 'full bias' is stored in the data structure. */
+#define GPS_CLOCK_HAS_FULL_BIAS                 (1<<2)
 /** A valid 'bias' is stored in the data structure. */
-#define GPS_CLOCK_HAS_BIAS                      (1<<2)
+#define GPS_CLOCK_HAS_BIAS                      (1<<3)
 /** A valid 'bias uncertainty' is stored in the data structure. */
-#define GPS_CLOCK_HAS_BIAS_UNCERTAINTY          (1<<3)
+#define GPS_CLOCK_HAS_BIAS_UNCERTAINTY          (1<<4)
 /** A valid 'drift' is stored in the data structure. */
-#define GPS_CLOCK_HAS_DRIFT                     (1<<4)
+#define GPS_CLOCK_HAS_DRIFT                     (1<<5)
 /** A valid 'drift uncertainty' is stored in the data structure. */
-#define GPS_CLOCK_HAS_DRIFT_UNCERTAINTY         (1<<5)
+#define GPS_CLOCK_HAS_DRIFT_UNCERTAINTY         (1<<6)
+
+/**
+ * Enumeration of the available values for the GPS Clock type.
+ */
+typedef uint8_t GpsClockType;
+/** The type is not available ot it is unknown. */
+#define GPS_CLOCK_TYPE_UNKNOWN                  0
+/** The source of the time value reported by GPS clock is the local hardware clock. */
+#define GPS_CLOCK_TYPE_LOCAL_HW_TIME            1
+/**
+ * The source of the time value reported by GPS clock is the GPS time derived from satellites
+ * (epoch = Jan 6, 1980)
+ */
+#define GPS_CLOCK_TYPE_GPS_TIME                 2
 
 /**
  * Flags to indicate what fields in GpsMeasurement are valid.
@@ -275,7 +291,7 @@
 #define GPS_MEASUREMENT_HAS_USED_IN_FIX                       (1<<17)
 
 /**
- * Flags that indicate the available values for the GPS Measurement's loss of lock.
+ * Enumeration of the available values for the GPS Measurement's loss of lock.
  */
 typedef uint8_t GpsLossOfLock;
 /** The indicator is not available or it is unknown. */
@@ -286,7 +302,7 @@
 #define GPS_LOSS_OF_LOCK_CYCLE_SLIP                         2
 
 /**
- * Flags that indicate the available values for the GPS Measurement's multipath indicator.
+ * Enumeration of available values for the GPS Measurement's multipath indicator.
  */
 typedef uint8_t GpsMultipathIndicator;
 /** The indicator is not available or unknown. */
@@ -297,7 +313,26 @@
 #define GPS_MULTIPATH_INDICATOR_NOT_USED                2
 
 /**
- * Flags to indicate the available GPS Natigation message types.
+ * Flags indicating the GPS measurement state.
+ */
+typedef uint16_t GpsMeasurementState;
+#define GPS_MEASUREMENT_STATE_UNKNOWN                   0
+#define GPS_MEASUREMENT_STATE_CODE_LOCK             (1<<0)
+#define GPS_MEASUREMENT_STATE_BIT_SYNC              (1<<1)
+#define GPS_MEASUREMENT_STATE_SUBFRAME_SYNC         (1<<2)
+#define GPS_MEASUREMENT_STATE_TOW_DECODED           (1<<3)
+
+/**
+ * Flags indicating the Accumulated Delta Range's states.
+ */
+typedef uint16_t GpsAccumulatedDeltaRangeState;
+#define GPS_ADR_STATE_UNKNOWN                       0
+#define GPS_ADR_STATE_VALID                     (1<<0)
+#define GPS_ADR_STATE_RESET                     (1<<1)
+#define GPS_ADR_STATE_CYCLE_SLIP                (1<<2)
+
+/**
+ * Enumeration of available values to indicate the available GPS Natigation message types.
  */
 typedef uint8_t GpsNavigationMessageType;
 /** The message type is unknown. */
@@ -1210,19 +1245,34 @@
 
     /**
      * Leap second data.
+     * The sign of the value is defined by the following equation:
+     *      utc_time_ns = time_ns + (full_bias_ns + bias_ns) - leap_second * 1,000,000,000
+     *
      * If the data is available 'flags' must contain GPS_CLOCK_HAS_LEAP_SECOND.
      */
     int16_t leap_second;
 
     /**
-     * The receiver's GPS time since 0000Z, January 6, 1980 in nanoseconds.
-     * It is referenced using the uncorrected receiver's clock ('bias_ns' included).
-     * The current precision allows a range that spans approximately to the end of the year 2272.
+     * Indicates the type of time reported by the 'time_ns' field.
+     * This is a Mandatory field.
+     */
+    GpsClockType type;
+
+    /**
+     * The GPS receiver internal clock value. This can be either the local hardware clock value
+     * (GPS_CLOCK_TYPE_LOCAL_HW_TIME), or the current GPS time derived inside GPS receiver
+     * (GPS_CLOCK_TYPE_GPS_TIME). The field 'type' defines the time reported.
      *
-     * Sub-nanosecond accuracy can be provided for each individual measurement using the field
-     * GpsMeasurement::time_offset_ns.
+     * For local hardware clock, this value is expected to be monotonically increasing during
+     * the reporting session. The real GPS time can be derived by compensating the 'full bias'
+     * (when it is available) from this value.
      *
+     * For GPS time, this value is expected to be the best estimation of current GPS time that GPS
+     * receiver can achieve. Set the 'time uncertainty' appropriately when GPS time is specified.
+     *
+     * Sub-nanosecond accuracy can be provided by means of the 'bias' field.
      * The value contains the 'time uncertainty' in it.
+     *
      * This is a Mandatory field.
      */
     int64_t time_ns;
@@ -1231,16 +1281,31 @@
      * 1-Sigma uncertainty associated with the clock's time in nanoseconds.
      * The uncertainty is represented as an absolute (single sided) value.
      *
+     * This value should be set if GPS_CLOCK_TYPE_GPS_TIME is set.
      * If the data is available 'flags' must contain GPS_CLOCK_HAS_TIME_UNCERTAINTY.
      */
     double time_uncertainty_ns;
 
     /**
-     * The clock's bias in nanoseconds.
-     * The sign of the value is defined by the following equation:
-     *    true time = time - bias.
+     * The difference between hardware clock ('time' field) inside GPS receiver and the true GPS
+     * time since 0000Z, January 6, 1980, in nanoseconds.
+     * This value is used if and only if GPS_CLOCK_TYPE_LOCAL_HW_TIME is set, and GPS receiver
+     * has solved the clock for GPS time.
+     * The caller is responsible for using the 'bias uncertainty' field for quality check.
      *
+     * The sign of the value is defined by the following equation:
+     *      true time (GPS time) = time_ns + (full_bias_ns + bias_ns)
+     *
+     * This value contains the 'bias uncertainty' in it.
+     * If the data is available 'flags' must contain GPS_CLOCK_HAS_FULL_BIAS.
+
+     */
+    int64_t full_bias_ns;
+
+    /**
+     * Sub-nanosecond bias.
      * The value contains the 'bias uncertainty' in it.
+     *
      * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS.
      */
     double bias_ns;
@@ -1288,25 +1353,45 @@
     int8_t prn;
 
     /**
-     * Local hardware time offset at which the measurement was taken in nanoseconds.
-     * The reference receiver's time is specified by GpsData::clock.
+     * Time offset at which the measurement was taken in nanoseconds.
+     * The reference receiver's time is specified by GpsData::clock::time_ns and should be
+     * interpreted in the same way as indicated by GpsClock::type.
+     *
      * The sign of time_offset_ns is given by the following equation:
      *      measurement time = GpsClock::time_ns + time_offset_ns
      *
      * It provides an individual time-stamp for the measurement, and allows sub-nanosecond accuracy.
      * This is a Mandatory value.
      */
-    int64_t time_offset_ns;
+    double time_offset_ns;
 
     /**
-     * Received GPS Time-of-Week in nanoseconds.
-     * The value is relative to the beginning of the current GPS week.
+     * Per satellite sync state. It represents the current sync state for the associated satellite.
+     * Based on the sync state, the 'received GPS tow' field should be interpreted accordingly.
      *
      * This is a Mandatory value.
      */
+    GpsMeasurementState state;
+
+    /**
+     * Received GPS Time-of-Week at the measurement time, in nanoseconds.
+     * The value is relative to the beginning of the current GPS week.
+     *
+     * Given the sync state of GPS receiver, per each satellite, valid range for this field can be:
+     *      Searching           : [ 0       ]   : GPS_MEASUREMENT_STATE_UNKNOWN
+     *      Ranging code lock   : [ 0   1ms ]   : GPS_MEASUREMENT_STATE_CODE_LOCK is set
+     *      Bit sync            : [ 0  20ms ]   : GPS_MEASUREMENT_STATE_BIT_SYNC is set
+     *      Subframe sync       : [ 0   6ms ]   : GPS_MEASUREMENT_STATE_SUBFRAME_SYNC is set
+     *      TOW decoded         : [ 0 1week ]   : GPS_MEASUREMENT_STATE_TOW_DECODED is set
+     */
     int64_t received_gps_tow_ns;
 
     /**
+     * 1-Sigma uncertainty of the Received GPS Time-of-Week in nanoseconds.
+     */
+    int64_t received_gps_tow_uncertainty_ns;
+
+    /**
      * Carrier-to-noise density in dB-Hz, in the range [0, 63].
      * It contains the measured C/N0 value for the signal at the antenna input.
      *
@@ -1324,7 +1409,7 @@
      *
      * This is a Mandatory value.
      */
-    double pseudorange_rate_mpersec;
+    double pseudorange_rate_mps;
 
     /**
      * 1-Sigma uncertainty of the pseudurange rate in m/s.
@@ -1332,19 +1417,25 @@
      *
      * This is a Mandatory value.
      */
-    double pseudorange_rate_uncertainty_mpersec;
+    double pseudorange_rate_uncertainty_mps;
+
+    /**
+     * Accumulated delta range's state. It indicates whether ADR is reset or there is a cycle slip
+     * (indicating loss of lock).
+     *
+     * This is a Mandatory value.
+     */
+    GpsAccumulatedDeltaRangeState accumulated_delta_range_state;
 
     /**
      * Accumulated delta range since the last channel reset in meters.
-     *
-     * This is a Mandatory value.
+     * The data is available if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN.
      */
     double accumulated_delta_range_m;
 
     /**
      * 1-Sigma uncertainty of the accumulated delta range in meters.
-     *
-     * This is a Mandatory value.
+     * The data is available if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN.
      */
     double accumulated_delta_range_uncertainty_m;
 
@@ -1429,10 +1520,10 @@
     int16_t bit_number;
 
     /**
-     * The elapsed time since the last received bit in nanoseconds, in the range [0, 20,000,000]
+     * The elapsed time since the last received bit in milliseconds, in the range [0, 20]
      * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT.
      */
-    int64_t time_from_last_bit_ns;
+    int16_t time_from_last_bit_ms;
 
     /**
      * Doppler shift in Hz.
@@ -1582,8 +1673,9 @@
 
     /**
      * Message identifier.
-     * It provides an index so the complete Navigation Message can be assembled.
-     * i.e. for L1 C/A the message id corresponds to the frame id of the navigation message.
+     * It provides an index so the complete Navigation Message can be assembled. i.e. fo L1 C/A
+     * subframe 4 and 5, this value corresponds to the 'frame id' of the navigation message.
+     * Subframe 1, 2, 3 does not contain a 'frame id' and this value can be set to -1.
      */
     int16_t message_id;
 
diff --git a/include/hardware/gralloc.h b/include/hardware/gralloc.h
index e7d0103..91e2f69 100644
--- a/include/hardware/gralloc.h
+++ b/include/hardware/gralloc.h
@@ -124,6 +124,9 @@
      */
     GRALLOC_USAGE_PROTECTED             = 0x00004000,
 
+    /* buffer may be used as a cursor */
+    GRALLOC_USAGE_CURSOR                = 0x00008000,
+
     /* implementation-specific private usage flags */
     GRALLOC_USAGE_PRIVATE_0             = 0x10000000,
     GRALLOC_USAGE_PRIVATE_1             = 0x20000000,
diff --git a/include/hardware/hdmi_cec.h b/include/hardware/hdmi_cec.h
index 95c0c4e..646dc45 100644
--- a/include/hardware/hdmi_cec.h
+++ b/include/hardware/hdmi_cec.h
@@ -339,7 +339,7 @@
      * some reason. HAL implementation should take the situation into account
      * so as not to wait forever for the message to get sent out.
      *
-     * It should try retransmission at least once as specified in the standard.
+     * It should not try retransmission because it's handled by upper layer.
      *
      * Returns error code. See HDMI_RESULT_SUCCESS, HDMI_RESULT_NACK, and
      * HDMI_RESULT_BUSY.
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index af04181..3dfb4fd 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -141,6 +141,13 @@
      *   as a solid color since the platform is not currently able to composite
      *   sideband layers with the GPU. This may be improved in future
      *   versions of the platform.
+     *
+     *
+     * HWC_CURSOR_OVERLAY
+     *   Set by the HWC implementation during (*prepare)(), this value
+     *   indicates the layer's composition will now be handled by the HWC.
+     *   Additionally, the client can now asynchronously update the on-screen
+     *   position of this layer using the setCursorPositionAsync() api.
      */
     int32_t compositionType;
 
@@ -505,11 +512,12 @@
      * (*prepare)() can be called more than once, the last call prevails.
      *
      * The HWC responds by setting the compositionType field in each layer to
-     * either HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the
-     * composition for the layer is handled by SurfaceFlinger with OpenGL ES,
-     * in the later case, the HWC will have to handle the layer's composition.
-     * compositionType and hints are preserved between (*prepare)() calles
-     * unless the HWC_GEOMETRY_CHANGED flag is set.
+     * either HWC_FRAMEBUFFER, HWC_OVERLAY, or HWC_CURSOR_OVERLAY. For the
+     * HWC_FRAMEBUFFER type, composition for the layer is handled by
+     * SurfaceFlinger with OpenGL ES. For the latter two overlay types,
+     * the HWC will have to handle the layer's composition. compositionType
+     * and hints are preserved between (*prepare)() calles unless the
+     * HWC_GEOMETRY_CHANGED flag is set.
      *
      * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the
      * list's geometry has changed, that is, when more than just the buffer's
@@ -751,11 +759,37 @@
      */
     int (*setActiveConfig)(struct hwc_composer_device_1* dev, int disp,
             int index);
+    /*
+     * Asynchronously update the location of the cursor layer.
+     *
+     * Within the standard prepare()/set() composition loop, the client
+     * (surfaceflinger) can request that a given layer uses dedicated cursor
+     * composition hardware by specifiying the HWC_IS_CURSOR_LAYER flag. Only
+     * one layer per display can have this flag set. If the layer is suitable
+     * for the platform's cursor hardware, hwcomposer will return from prepare()
+     * a composition type of HWC_CURSOR_OVERLAY for that layer. This indicates
+     * not only that the client is not responsible for compositing that layer,
+     * but also that the client can continue to update the position of that layer
+     * after a call to set(). This can reduce the visible latency of mouse
+     * movement to visible, on-screen cursor updates. Calls to
+     * setCursorPositionAsync() may be made from a different thread doing the
+     * prepare()/set() composition loop, but care must be taken to not interleave
+     * calls of setCursorPositionAsync() between calls of set()/prepare().
+     *
+     * Notes:
+     * - Only one layer per display can be specified as a cursor layer with
+     *   HWC_IS_CURSOR_LAYER.
+     * - hwcomposer will only return one layer per display as HWC_CURSOR_OVERLAY
+     * - This returns 0 on success or -errno on error.
+     * - This field is optional for HWC_DEVICE_API_VERSION_1_4 and later. It
+     *   should be null for previous versions.
+     */
+    int (*setCursorPositionAsync)(struct hwc_composer_device_1 *dev, int disp, int x_pos, int y_pos);
 
     /*
      * Reserved for future use. Must be NULL.
      */
-    void* reserved_proc[2];
+    void* reserved_proc[1];
 
 } hwc_composer_device_1_t;
 
diff --git a/include/hardware/hwcomposer_defs.h b/include/hardware/hwcomposer_defs.h
index d24bc9d..9a52436 100644
--- a/include/hardware/hwcomposer_defs.h
+++ b/include/hardware/hwcomposer_defs.h
@@ -77,6 +77,16 @@
      * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY).
      */
     HWC_SKIP_LAYER = 0x00000001,
+
+    /*
+     * HWC_IS_CURSOR_LAYER is set by surfaceflinger to indicate that this
+     * layer is being used as a cursor on this particular display, and that
+     * surfaceflinger can potentially perform asynchronous position updates for
+     * this layer. If a call to prepare() returns HWC_CURSOR_OVERLAY for the
+     * composition type of this layer, then the hwcomposer will allow async
+     * position updates to this layer via setCursorPositionAsync().
+     */
+    HWC_IS_CURSOR_LAYER = 0x00000002
 };
 
 /*
@@ -100,8 +110,13 @@
     /* this layer's contents are taken from a sideband buffer stream.
      * Added in HWC_DEVICE_API_VERSION_1_4. */
     HWC_SIDEBAND = 4,
-};
 
+    /* this layer's composition will be handled by hwcomposer by dedicated
+       cursor overlay hardware. hwcomposer will also all async position updates
+       of this layer outside of the normal prepare()/set() loop. Added in
+       HWC_DEVICE_API_VERSION_1_4. */
+    HWC_CURSOR_OVERLAY =  5
+ };
 /*
  * hwc_layer_t::blending values
  */
diff --git a/include/hardware/nfc.h b/include/hardware/nfc.h
index 0a8ed72..58d33d9 100644
--- a/include/hardware/nfc.h
+++ b/include/hardware/nfc.h
@@ -53,6 +53,7 @@
  * 9) Core NCI stack calls close()
  */
 #define NFC_NCI_HARDWARE_MODULE_ID "nfc_nci"
+#define NFC_NCI_BCM2079X_HARDWARE_MODULE_ID "nfc_nci.bcm2079x"
 #define NFC_NCI_CONTROLLER "nci"
 
 /*
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index ec68b2b..373724e 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -611,7 +611,7 @@
  * before (desk, pocket, bag). The only allowed return value is 1.0.
  * This sensor de-activates itself immediately after it triggers.
  */
-#define SENSOR_TYPE_PICK_UP_GESTURE                            (43)
+#define SENSOR_TYPE_PICK_UP_GESTURE                            (44)
 #define SENSOR_STRING_TYPE_PICK_UP_GESTURE                     "android.sensor.pick_up_gesture"
 
 /**
diff --git a/tests/hardware/struct-offset.cpp b/tests/hardware/struct-offset.cpp
index 2354408..a7ff797 100644
--- a/tests/hardware/struct-offset.cpp
+++ b/tests/hardware/struct-offset.cpp
@@ -169,7 +169,8 @@
     CHECK_MEMBER_AT(hwc_composer_device_1_t, getDisplayAttributes, 96, 184);
     CHECK_MEMBER_AT(hwc_composer_device_1_t, getActiveConfig, 100, 192);
     CHECK_MEMBER_AT(hwc_composer_device_1_t, setActiveConfig, 104, 200);
-    CHECK_MEMBER_AT(hwc_composer_device_1_t, reserved_proc, 108, 208);
+    CHECK_MEMBER_AT(hwc_composer_device_1_t, setCursorPositionAsync, 108, 208);
+    CHECK_MEMBER_AT(hwc_composer_device_1_t, reserved_proc, 112, 216);
 
     //Types defined in gralloc.h
     CHECK_MEMBER_AT(gralloc_module_t, common, 0, 0);