summaryrefslogtreecommitdiffstats
path: root/audio_a2dp_hw
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-08-02 11:26:57 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-08-02 11:37:50 -0700
commitccde045431d38d4828412149f067631487f8025f (patch)
treee54c3e18a449d800f32a0cb493e6180dc66235d1 /audio_a2dp_hw
parent95b17c4c4309cfee7fc0fc180dc9133195579c8b (diff)
parent472271b153c5dc53c28beac55480a8d8434b2d5c (diff)
downloadandroid_system_bt-ccde045431d38d4828412149f067631487f8025f.tar.gz
android_system_bt-ccde045431d38d4828412149f067631487f8025f.tar.bz2
android_system_bt-ccde045431d38d4828412149f067631487f8025f.zip
Merge tag 'android-6.0.1_r61' into HEADreplicant-6.0-0001stable/cm-13.0-ZNH5Y
Android 6.0.1 Release 61 (MOB30Z) Change-Id: Icda48d6c36e74365e608d80f0054fc58d8febc26
Diffstat (limited to 'audio_a2dp_hw')
-rw-r--r--audio_a2dp_hw/audio_a2dp_hw.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/audio_a2dp_hw/audio_a2dp_hw.c b/audio_a2dp_hw/audio_a2dp_hw.c
index 1933d5a75..663dbb83e 100644
--- a/audio_a2dp_hw/audio_a2dp_hw.c
+++ b/audio_a2dp_hw/audio_a2dp_hw.c
@@ -297,7 +297,7 @@ static int skt_read(int fd, void *p, size_t len)
ts_log("skt_read recv", len, NULL);
- if ((read = recv(fd, p, len, MSG_NOSIGNAL)) == -1)
+ if ((read = TEMP_FAILURE_RETRY(recv(fd, p, len, MSG_NOSIGNAL))) == -1)
{
ERROR("write failed with errno=%d\n", errno);
return -1;
@@ -319,12 +319,12 @@ static int skt_write(int fd, const void *p, size_t len)
/* poll for 500 ms */
/* send time out */
- if (poll(&pfd, 1, 500) == 0)
+ if (TEMP_FAILURE_RETRY(poll(&pfd, 1, 500)) == 0)
return 0;
ts_log("skt_write", len, NULL);
- if ((sent = send(fd, p, len, MSG_NOSIGNAL)) == -1)
+ if ((sent = TEMP_FAILURE_RETRY(send(fd, p, len, MSG_NOSIGNAL))) == -1)
{
ERROR("write failed with errno=%d\n", errno);
return -1;
@@ -355,14 +355,14 @@ static int skt_disconnect(int fd)
static int a2dp_ctrl_receive(struct a2dp_stream_common *common, void* buffer, int length)
{
- int ret = recv(common->ctrl_fd, buffer, length, MSG_NOSIGNAL);
+ int ret = TEMP_FAILURE_RETRY(recv(common->ctrl_fd, buffer, length, MSG_NOSIGNAL));
if (ret < 0)
{
ERROR("ack failed (%s)", strerror(errno));
if (errno == EINTR)
{
/* retry again */
- ret = recv(common->ctrl_fd, buffer, length, MSG_NOSIGNAL);
+ ret = TEMP_FAILURE_RETRY(recv(common->ctrl_fd, buffer, length, MSG_NOSIGNAL));
if (ret < 0)
{
ERROR("ack failed (%s)", strerror(errno));
@@ -389,7 +389,7 @@ static int a2dp_command(struct a2dp_stream_common *common, char cmd)
INFO("A2DP COMMAND %s", dump_a2dp_ctrl_event(cmd));
/* send command */
- if (send(common->ctrl_fd, &cmd, 1, MSG_NOSIGNAL) == -1)
+ if (TEMP_FAILURE_RETRY(send(common->ctrl_fd, &cmd, 1, MSG_NOSIGNAL)) == -1)
{
ERROR("cmd failed (%s)", strerror(errno));
skt_disconnect(common->ctrl_fd);
@@ -463,13 +463,13 @@ static void a2dp_open_ctrl_path(struct a2dp_stream_common *common)
break;
ERROR("error : a2dp not ready, wait 250 ms and retry");
- usleep(250000);
+ TEMP_FAILURE_RETRY(usleep(250000));
skt_disconnect(common->ctrl_fd);
common->ctrl_fd = AUDIO_SKT_DISCONNECTED;
}
/* ctrl channel not ready, wait a bit */
- usleep(250000);
+ TEMP_FAILURE_RETRY(usleep(250000));
}
}
@@ -675,7 +675,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer,
ERROR("emulate a2dp write delay (%d us)", us_delay);
- usleep(us_delay);
+ TEMP_FAILURE_RETRY(usleep(us_delay));
pthread_mutex_unlock(&out->common.lock);
return -1;
}
@@ -1170,7 +1170,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
DEBUG("emulate a2dp read delay (%d us)", us_delay);
- usleep(us_delay);
+ TEMP_FAILURE_RETRY(usleep(us_delay));
pthread_mutex_unlock(&in->common.lock);
return -1;
}
@@ -1304,7 +1304,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
INFO("success");
/* Delay to ensure Headset is in proper state when START is initiated
from DUT immediately after the connection due to ongoing music playback. */
- usleep(250000);
+ TEMP_FAILURE_RETRY(usleep(250000));
return 0;
err_open: