Merge "Add Skip Validate capability to hwc2 interface"
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..12e0d27
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,3 @@
+eisenbach@google.com
+jpawlowski@google.com
+swillden@google.com
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index 154cb09..98d50d5 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -276,11 +276,11 @@
     bt_status_t (*conn_parameter_update)(const bt_bdaddr_t *bd_addr, int min_interval,
                     int max_interval, int latency, int timeout);
 
-    bt_status_t (*set_preferred_phy)(int conn_id, uint8_t tx_phy,
+    bt_status_t (*set_preferred_phy)(const bt_bdaddr_t& bd_addr, uint8_t tx_phy,
                                      uint8_t rx_phy, uint16_t phy_options);
 
     bt_status_t (*read_phy)(
-        int conn_id,
+        const bt_bdaddr_t& bd_addr,
         base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)>
             cb);
 
diff --git a/include/hardware/bt_gatt_server.h b/include/hardware/bt_gatt_server.h
index 36259a1..fcc0f30 100644
--- a/include/hardware/bt_gatt_server.h
+++ b/include/hardware/bt_gatt_server.h
@@ -166,11 +166,11 @@
     bt_status_t (*send_response)(int conn_id, int trans_id,
                                  int status, btgatt_response_t *response);
 
-    bt_status_t (*set_preferred_phy)(int conn_id, uint8_t tx_phy,
+    bt_status_t (*set_preferred_phy)(const bt_bdaddr_t& bd_addr, uint8_t tx_phy,
                                      uint8_t rx_phy, uint16_t phy_options);
 
     bt_status_t (*read_phy)(
-        int conn_id,
+        const bt_bdaddr_t& bd_addr,
         base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)>
             cb);
 
diff --git a/include/hardware/bt_hf.h b/include/hardware/bt_hf.h
index 892fbdb..2b89c91 100644
--- a/include/hardware/bt_hf.h
+++ b/include/hardware/bt_hf.h
@@ -323,6 +323,9 @@
     /** Response for HF Indicator change (+BIND) */
     bt_status_t (*bind_response)(bthf_hf_ind_type_t ind_id, bthf_hf_ind_status_t ind_status,
                                  bt_bdaddr_t *bd_addr);
+
+    /** Whether we will initiate SCO or not **/
+    bt_status_t (*set_sco_allowed)(bool value);
 } bthf_interface_t;
 
 __END_DECLS
diff --git a/modules/audio_remote_submix/Android.mk b/modules/audio_remote_submix/Android.mk
index c9e851f..27c7795 100644
--- a/modules/audio_remote_submix/Android.mk
+++ b/modules/audio_remote_submix/Android.mk
@@ -30,5 +30,6 @@
 LOCAL_MODULE_TAGS := optional
 LOCAL_CFLAGS := -Wno-unused-parameter
 
+LOCAL_HEADER_LIBRARIES += libhardware_headers
 include $(BUILD_SHARED_LIBRARY)
 
diff --git a/modules/radio/radio_hw.c b/modules/radio/radio_hw.c
index 29204df..93b8c88 100644
--- a/modules/radio/radio_hw.c
+++ b/modules/radio/radio_hw.c
@@ -114,8 +114,19 @@
     CMD_CANCEL,
     CMD_METADATA,
     CMD_ANNOUNCEMENTS,
+    CMD_NUM
 } thread_cmd_type_t;
 
+uint32_t thread_cmd_delay_ms[CMD_NUM] = {
+    [CMD_EXIT]          = 0,
+    [CMD_CONFIG]        = 50,
+    [CMD_STEP]          = 100,
+    [CMD_SCAN]          = 200,
+    [CMD_TUNE]          = 150,
+    [CMD_CANCEL]        = 0,
+    [CMD_METADATA]      = 1000,
+    [CMD_ANNOUNCEMENTS] = 1000
+};
 struct thread_command {
     struct listnode node;
     thread_cmd_type_t type;
@@ -401,7 +412,7 @@
                                                 (tuner->config.spacings[0] * 5)) % 2;
 
                     if (tuner->program.tuned) {
-                        send_command_l(tuner, CMD_ANNOUNCEMENTS, 1000, NULL);
+                        send_command_l(tuner, CMD_ANNOUNCEMENTS, thread_cmd_delay_ms[CMD_ANNOUNCEMENTS], NULL);
                     }
                     tuner->program.signal_strength = 100;
                     if (tuner->config.type == RADIO_BAND_FM)
@@ -481,7 +492,7 @@
                     free(cmd);
                 }
             }
-            send_command_l(tuner, CMD_METADATA, 1000, NULL);
+            send_command_l(tuner, CMD_METADATA, thread_cmd_delay_ms[CMD_METADATA], NULL);
         }
     }
 
@@ -510,8 +521,8 @@
         status = -EINVAL;
         goto exit;
     }
-    send_command_l(stub_tuner, CMD_CANCEL, 0, NULL);
-    send_command_l(stub_tuner, CMD_CONFIG, 500, (void *)config);
+    send_command_l(stub_tuner, CMD_CANCEL, thread_cmd_delay_ms[CMD_CANCEL], NULL);
+    send_command_l(stub_tuner, CMD_CONFIG, thread_cmd_delay_ms[CMD_CONFIG], (void *)config);
 
 exit:
     pthread_mutex_unlock(&stub_tuner->lock);
@@ -556,7 +567,7 @@
           __func__, stub_tuner, direction, skip_sub_channel);
 
     pthread_mutex_lock(&stub_tuner->lock);
-    send_command_l(stub_tuner, CMD_STEP, 20, &direction);
+    send_command_l(stub_tuner, CMD_STEP, thread_cmd_delay_ms[CMD_STEP], &direction);
     pthread_mutex_unlock(&stub_tuner->lock);
     return 0;
 }
@@ -570,7 +581,7 @@
           __func__, stub_tuner, direction, skip_sub_channel);
 
     pthread_mutex_lock(&stub_tuner->lock);
-    send_command_l(stub_tuner, CMD_SCAN, 200, &direction);
+    send_command_l(stub_tuner, CMD_SCAN, thread_cmd_delay_ms[CMD_SCAN], &direction);
     pthread_mutex_unlock(&stub_tuner->lock);
     return 0;
 }
@@ -589,7 +600,7 @@
         ALOGI("%s channel out of range", __func__);
         return -EINVAL;
     }
-    send_command_l(stub_tuner, CMD_TUNE, 100, &channel);
+    send_command_l(stub_tuner, CMD_TUNE, thread_cmd_delay_ms[CMD_TUNE], &channel);
     pthread_mutex_unlock(&stub_tuner->lock);
     return 0;
 }
@@ -601,7 +612,7 @@
     ALOGI("%s stub_tuner %p", __func__, stub_tuner);
 
     pthread_mutex_lock(&stub_tuner->lock);
-    send_command_l(stub_tuner, CMD_CANCEL, 0, NULL);
+    send_command_l(stub_tuner, CMD_CANCEL, thread_cmd_delay_ms[CMD_CANCEL], NULL);
     pthread_mutex_unlock(&stub_tuner->lock);
     return 0;
 }
@@ -696,7 +707,7 @@
     list_init(&rdev->tuner->command_list);
 
     pthread_mutex_lock(&rdev->tuner->lock);
-    send_command_l(rdev->tuner, CMD_CONFIG, 500, (void *)config);
+    send_command_l(rdev->tuner, CMD_CONFIG, thread_cmd_delay_ms[CMD_CONFIG], (void *)config);
     pthread_mutex_unlock(&rdev->tuner->lock);
 
     *tuner = &rdev->tuner->interface;
@@ -724,7 +735,7 @@
 
     pthread_mutex_lock(&stub_tuner->lock);
     stub_tuner->callback = NULL;
-    send_command_l(stub_tuner, CMD_EXIT, 0, NULL);
+    send_command_l(stub_tuner, CMD_EXIT, thread_cmd_delay_ms[CMD_EXIT], NULL);
     pthread_mutex_unlock(&stub_tuner->lock);
     pthread_join(stub_tuner->callback_thread, (void **) NULL);
 
diff --git a/modules/thermal/Android.mk b/modules/thermal/Android.mk
index ff51145..f33d87c 100644
--- a/modules/thermal/Android.mk
+++ b/modules/thermal/Android.mk
@@ -20,7 +20,7 @@
 LOCAL_MODULE_RELATIVE_PATH := hw
 LOCAL_PROPRIETARY_MODULE := true
 LOCAL_SRC_FILES := thermal.c
-LOCAL_SHARED_LIBRARIES := liblog libcutils
+LOCAL_SHARED_LIBRARIES := liblog libcutils libutils
 LOCAL_MODULE_TAGS := optional
 LOCAL_CFLAGS := -Wno-unused-parameter
 
diff --git a/modules/usbaudio/Android.mk b/modules/usbaudio/Android.mk
index b36bf9f..6c8a98f 100644
--- a/modules/usbaudio/Android.mk
+++ b/modules/usbaudio/Android.mk
@@ -29,5 +29,6 @@
 LOCAL_MODULE_TAGS := optional
 LOCAL_CFLAGS := -Wno-unused-parameter
 
+LOCAL_HEADER_LIBRARIES += libhardware_headers
 include $(BUILD_SHARED_LIBRARY)