merge in jb-release history after reset to master
diff --git a/audio/android_audio_hw.c b/audio/android_audio_hw.c
index 0746109..ca399bf 100644
--- a/audio/android_audio_hw.c
+++ b/audio/android_audio_hw.c
@@ -601,10 +601,19 @@
return 0;
}
+#ifdef AUDIO_DEVICE_API_VERSION_1_0
+static int adev_open_output_stream(struct audio_hw_device *dev,
+ audio_io_handle_t handle,
+ audio_devices_t devices,
+ audio_output_flags_t flags,
+ struct audio_config *config,
+ struct audio_stream_out **stream_out)
+#else
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,
struct audio_stream_out **stream_out)
+#endif
{
struct adev_a2dp *adev = (struct adev_a2dp *)dev;
struct astream_out *out;
@@ -662,9 +671,16 @@
out->buffer_duration_us = ((out->buffer_size * 1000 ) /
audio_stream_frame_size(&out->stream.common) /
out->sample_rate) * 1000;
+#ifdef AUDIO_DEVICE_API_VERSION_1_0
+ if (!_out_validate_parms(out, config->format,
+ config->channel_mask,
+ config->sample_rate))
+#else
if (!_out_validate_parms(out, format ? *format : 0,
channels ? *channels : 0,
- sample_rate ? *sample_rate : 0)) {
+ sample_rate ? *sample_rate : 0))
+#endif
+ {
ALOGV("invalid parameters");
ret = -EINVAL;
goto err_validate_parms;
@@ -688,13 +704,18 @@
adev->output = out;
+#ifdef AUDIO_DEVICE_API_VERSION_1_0
+ config->format = out->format;
+ config->channel_mask = out->channels;
+ config->sample_rate = out->sample_rate;
+#else
if (format)
*format = out->format;
if (channels)
*channels = out->channels;
if (sample_rate)
*sample_rate = out->sample_rate;
-
+#endif
pthread_mutex_unlock(&adev->lock);
*stream_out = &out->stream;
@@ -856,19 +877,32 @@
return -ENOSYS;
}
+#ifdef AUDIO_DEVICE_API_VERSION_1_0
+static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev,
+ const struct audio_config *config)
+#else
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)
+#endif
{
/* no input */
return 0;
}
+#ifdef AUDIO_DEVICE_API_VERSION_1_0
+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)
+#else
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,
struct audio_stream_in **stream_in)
+#endif
{
return -ENOSYS;
}
@@ -921,7 +955,11 @@
adev->output = NULL;
adev->device.common.tag = HARDWARE_DEVICE_TAG;
+#ifdef AUDIO_DEVICE_API_VERSION_1_0
+ adev->device.common.version = AUDIO_DEVICE_API_VERSION_1_0;
+#else
adev->device.common.version = 0;
+#endif
adev->device.common.module = (struct hw_module_t *) module;
adev->device.common.close = adev_close;
@@ -957,8 +995,13 @@
struct audio_module HAL_MODULE_INFO_SYM = {
.common = {
.tag = HARDWARE_MODULE_TAG,
+#ifdef AUDIO_MODULE_API_VERSION_0_1
+ .module_api_version = AUDIO_MODULE_API_VERSION_0_1,
+ .hal_api_version = HARDWARE_HAL_API_VERSION,
+#else
.version_major = 1,
.version_minor = 0,
+#endif
.id = AUDIO_HARDWARE_MODULE_ID,
.name = "A2DP Audio HW HAL",
.author = "The Android Open Source Project",