audio: update to new audio HAL device API.

Change-Id: Iba0802f8d03bc57ecf32736f5eb8beb59ac56f39
diff --git a/audio/android_audio_hw.c b/audio/android_audio_hw.c
index 0746109..12cbd8d 100644
--- a/audio/android_audio_hw.c
+++ b/audio/android_audio_hw.c
@@ -602,8 +602,10 @@
 }
 
 static int adev_open_output_stream(struct audio_hw_device *dev,
-                                   uint32_t devices, audio_format_t *format,
-                                   uint32_t *channels, uint32_t *sample_rate,
+                                   audio_io_handle_t handle,
+                                   audio_devices_t devices,
+                                   audio_output_flags_t flags,
+                                   struct audio_config *config,
                                    struct audio_stream_out **stream_out)
 {
     struct adev_a2dp *adev = (struct adev_a2dp *)dev;
@@ -662,9 +664,9 @@
     out->buffer_duration_us = ((out->buffer_size * 1000 ) /
                                audio_stream_frame_size(&out->stream.common) /
                                out->sample_rate) * 1000;
-    if (!_out_validate_parms(out, format ? *format : 0,
-                             channels ? *channels : 0,
-                             sample_rate ? *sample_rate : 0)) {
+    if (!_out_validate_parms(out, config->format,
+                             config->channel_mask,
+                             config->sample_rate)) {
         ALOGV("invalid parameters");
         ret = -EINVAL;
         goto err_validate_parms;
@@ -688,12 +690,9 @@
 
     adev->output = out;
 
-    if (format)
-        *format = out->format;
-    if (channels)
-        *channels = out->channels;
-    if (sample_rate)
-        *sample_rate = out->sample_rate;
+    config->format = out->format;
+    config->channel_mask = out->channels;
+    config->sample_rate = out->sample_rate;
 
     pthread_mutex_unlock(&adev->lock);
 
@@ -857,17 +856,16 @@
 }
 
 static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev,
-                                         uint32_t sample_rate, audio_format_t format,
-                                         int channel_count)
+                                         const struct audio_config *config)
 {
     /* no input */
     return 0;
 }
 
-static int adev_open_input_stream(struct audio_hw_device *dev, uint32_t devices,
-                                  audio_format_t *format, uint32_t *channels,
-                                  uint32_t *sample_rate,
-                                  audio_in_acoustics_t acoustics,
+static int adev_open_input_stream(struct audio_hw_device *dev,
+                                  audio_io_handle_t handle,
+                                  audio_devices_t devices,
+                                  struct audio_config *config,
                                   struct audio_stream_in **stream_in)
 {
     return -ENOSYS;
@@ -921,7 +919,7 @@
     adev->output = NULL;
 
     adev->device.common.tag = HARDWARE_DEVICE_TAG;
-    adev->device.common.version = 0;
+    adev->device.common.version = AUDIO_DEVICE_API_VERSION_1_0;
     adev->device.common.module = (struct hw_module_t *) module;
     adev->device.common.close = adev_close;
 
@@ -957,8 +955,8 @@
 struct audio_module HAL_MODULE_INFO_SYM = {
     .common = {
         .tag = HARDWARE_MODULE_TAG,
-        .version_major = 1,
-        .version_minor = 0,
+        .module_api_version = AUDIO_MODULE_API_VERSION_0_1,
+        .hal_api_version = HARDWARE_HAL_API_VERSION,
         .id = AUDIO_HARDWARE_MODULE_ID,
         .name = "A2DP Audio HW HAL",
         .author = "The Android Open Source Project",