[PATCH 4/4] android/hal: Add missing a2dp handler introduced in Android 5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is added just to be fair with the IPC mechanism and this callback
should never be called by A2DP Source. It is valid for Sink role only.
---
 android/hal-a2dp.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/android/hal-a2dp.c b/android/hal-a2dp.c
index 3556218..ca92b0e 100644
--- a/android/hal-a2dp.c
+++ b/android/hal-a2dp.c
@@ -48,6 +48,17 @@ static void handle_audio_state(void *buf, uint16_t len, int fd)
 		cbs->audio_state_cb(ev->state, (bt_bdaddr_t *)(ev->bdaddr));
 }
 
+static void handle_audio_config(void *buf, uint16_t len, int fd)
+{
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+	struct hal_ev_a2dp_audio_config *ev = buf;
+
+	if (cbs->audio_config_cb)
+		cbs->audio_config_cb((bt_bdaddr_t *)(ev->bdaddr),
+					ev->sample_rate, ev->channel_count);
+#endif
+}
+
 /*
  * handlers will be called from notification thread context,
  * index in table equals to 'opcode - HAL_MINIMUM_EVENT'
@@ -57,6 +68,8 @@ static const struct hal_ipc_handler ev_handlers[] = {
 	{ handle_conn_state, false, sizeof(struct hal_ev_a2dp_conn_state) },
 	/* HAL_EV_A2DP_AUDIO_STATE */
 	{ handle_audio_state, false, sizeof(struct hal_ev_a2dp_audio_state) },
+	/* HAL_EV_A2DP_AUDIO_CONFIG */
+	{ handle_audio_config, false, sizeof(struct hal_ev_a2dp_audio_config) },
 };
 
 static bt_status_t a2dp_connect(bt_bdaddr_t *bd_addr)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux