Merge "Add HWC 1.4 with support for sideband video layers"
diff --git a/include/hardware/bt_pan.h b/include/hardware/bt_pan.h
index c8b36b4..83e7949 100644
--- a/include/hardware/bt_pan.h
+++ b/include/hardware/bt_pan.h
@@ -40,8 +40,8 @@
 */
 typedef void (*btpan_connection_state_callback)(btpan_connection_state_t state, bt_status_t error,
                                                 const bt_bdaddr_t *bd_addr, int local_role, int remote_role);
-typedef void (*btpan_control_state_callback)(btpan_control_state_t state, bt_status_t error,
-                                            int local_role, const char* ifname);
+typedef void (*btpan_control_state_callback)(btpan_control_state_t state, int local_role,
+                                            bt_status_t error, const char* ifname);
 
 typedef struct {
     size_t size;
diff --git a/include/hardware/hdmi_cec.h b/include/hardware/hdmi_cec.h
index 938e9dc..a697334 100644
--- a/include/hardware/hdmi_cec.h
+++ b/include/hardware/hdmi_cec.h
@@ -194,7 +194,7 @@
  * Callback function type that will be called by HAL implementation.
  * Services can not close/open the device in the callback.
  */
-typedef void (*event_callback_t)(const hdmi_event_t* event);
+typedef void (*event_callback_t)(const hdmi_event_t* event, void* arg);
 
 typedef struct hdmi_cec_module {
     struct hw_module_t common;
@@ -214,12 +214,26 @@
      * is not successful the addr will be set to CEC_ADDR_UNREGISTERED.
      *
      * Returns 0 on success or -errno on error.
-     *
      */
     int (*allocate_logical_address)(const struct hdmi_cec_device* dev,
             int device_type, cec_logical_address_t* addr);
 
     /*
+     * (*get_logical_address)() returns the logical address already allocated
+     * for the device of the given type. It is necessary to call this function
+     * when HAL implementation, without being triggered by service, updated
+     * the address by itself. Such situation happens when an event like
+     * hotplug occurs, since it is possible the HDMI network topology or
+     * the port which the device was connected to might have changed while it
+     * was unplugged. In response to such events, the service is required to
+     * call this function to get the updated address. The address is written
+     * to addr.
+     *
+     * Returns 0 on success or -errno on error.
+     */
+    int (*get_logical_address)(const struct hdmi_cec_device* dev,
+            int device_type, cec_logical_address_t* addr);
+    /*
      * (*get_physical_address)() returns the CEC physical address. The
      * address is written to addr.
      *
@@ -238,14 +252,17 @@
      * Returns 0 on success or -errno on error.
      */
     int (*send_message)(const struct hdmi_cec_device* dev,
-            const cec_message_t *);
+            const cec_message_t*);
 
     /*
      * (*register_event_callback)() registers a callback that HDMI-CEC HAL
      * can later use for incoming CEC messages or internal HDMI events.
+     * When calling from C++, use the argument arg to pass the calling object.
+     * It will be passed back when the callback is invoked so that the context
+     * can be retrieved.
      */
     void (*register_event_callback)(const struct hdmi_cec_device* dev,
-            event_callback_t callback);
+            event_callback_t callback, void* arg);
 
     /*
      * (*get_version)() returns the CEC version supported by underlying
@@ -262,7 +279,7 @@
     void (*get_vendor_id)(const struct hdmi_cec_device* dev, uint32_t* vendor_id);
 
     /* Reserved for future use to maximum 16 functions. Must be NULL. */
-    void* reserved[16 - 6];
+    void* reserved[16 - 7];
 } hdmi_cec_device_t;
 
 /** convenience API for opening and closing a device */