summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorKevin Rocard <krocard@google.com>2017-05-02 16:38:39 -0700
committerAndré Pinela <sheffzor@gmail.com>2017-10-06 15:32:25 +0100
commit9184f2487c85d433a99efac1393248ba2c9bfdee (patch)
tree47c667a7e0aa14687fd201c94e46dcff68e9233d /audio
parentac3d6b787b5d852c5f2425072329c39340c9bbca (diff)
HAL: Align error code with HIDL wrapper
Here is how the HIDL wrapper interprets status error codes: 0 => Result::OK -EINVAL => Result::INVALID_ARGUMENTS -ENODATA => Result::INVALID_STATE -ENODEV => Result::NOT_INITIALIZED -ENOSYS => Result::NOT_SUPPORTED otherwise => Result::INVALID_STATE This is consistent with most of the hal. This patch changes the few places where it was not to unify the behaviours. Test: vts-tradefed run vts --module VtsHalAudioV2_0Target Test: call/play music/record/video... Bug: 36311550 Change-Id: Id821d15ae3269cd2c9699924e2b174c7347a6d07 Signed-off-by: Kevin Rocard <krocard@google.com> Signed-off-by: André Pinela <sheffzor@gmail.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 7e26e1f..cdaf436 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -654,7 +654,7 @@ exit:
static int out_get_render_position(const struct audio_stream_out *stream,
uint32_t *dsp_frames)
{
- return -EINVAL;
+ return -ENODATA;
}
static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
@@ -670,14 +670,14 @@ static int out_remove_audio_effect(const struct audio_stream *stream, effect_han
static int out_get_next_write_timestamp(const struct audio_stream_out *stream,
int64_t *timestamp)
{
- return -EINVAL;
+ return -ENOSYS;
}
static int out_get_presentation_position(const struct audio_stream_out *stream,
uint64_t *frames, struct timespec *timestamp)
{
struct stream_out *out = (struct stream_out *)stream;
- int ret = -1;
+ int ret = -ENODATA;
pthread_mutex_lock(&out->lock);
@@ -807,7 +807,7 @@ static char * in_get_parameters(const struct audio_stream *stream,
static int in_set_gain(struct audio_stream_in *stream, float gain)
{
- return 0;
+ return -ENOSYS;
}
static ssize_t in_read(struct audio_stream_in *stream, void* buffer,