diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-01-21 16:00:58 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-01-21 16:20:54 +0100 |
commit | c26f5203fdba0b9e6fa3a1eed2d9546fd48f44dd (patch) | |
tree | d99ed0f20fd718edd8df2925adacaefc66f82786 /android/ipc.c | |
parent | 5b67d64e79cb76bbd12234ee7e7edbe04a1dfb56 (diff) | |
download | bluez-c26f5203fdba0b9e6fa3a1eed2d9546fd48f44dd.tar.gz |
android/A2DP: Add retry logic to Audio IPC
In case the audio HAL disconnects without cleaning up its endpoints treat
it as unclean disconnection and attempt to reconnect.
Diffstat (limited to 'android/ipc.c')
-rw-r--r-- | android/ipc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/android/ipc.c b/android/ipc.c index ed3ef3c0f..8098409ff 100644 --- a/android/ipc.c +++ b/android/ipc.c @@ -141,7 +141,8 @@ static gboolean notif_watch_cb(GIOChannel *io, GIOCondition cond, return FALSE; } -GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb) +GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb, + void *user_data) { struct sockaddr_un addr; GIOCondition cond; @@ -174,7 +175,7 @@ GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb) cond = G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL; - g_io_add_watch(io, cond, connect_cb, NULL); + g_io_add_watch(io, cond, connect_cb, user_data); return io; } @@ -215,7 +216,7 @@ static gboolean cmd_connect_cb(GIOChannel *io, GIOCondition cond, } notif_io = ipc_connect(BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH), - notif_connect_cb); + notif_connect_cb, NULL); if (!notif_io) raise(SIGTERM); @@ -225,7 +226,7 @@ static gboolean cmd_connect_cb(GIOChannel *io, GIOCondition cond, void ipc_init(void) { cmd_io = ipc_connect(BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH), - cmd_connect_cb); + cmd_connect_cb, NULL); if (!cmd_io) raise(SIGTERM); } |