summaryrefslogtreecommitdiff
path: root/android/hal-handsfree.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-11-05 16:38:46 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-11-06 12:08:06 +0100
commite16ccc08874f9d04f31d648be8554ae85c9f63ad (patch)
tree301fccdd01b49d6aecc944a8c1eb119965862adb /android/hal-handsfree.c
parentb36434f47ac034869bd42f23ac7b0d09dc1fdd62 (diff)
downloadbluez-e16ccc08874f9d04f31d648be8554ae85c9f63ad.tar.gz
android/handsfree: Add support for new API for start_vr
start_voice_recognition() in new Android API has bd_addr parameter.
Diffstat (limited to 'android/hal-handsfree.c')
-rw-r--r--android/hal-handsfree.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/android/hal-handsfree.c b/android/hal-handsfree.c
index c575d2bae..304281a6b 100644
--- a/android/hal-handsfree.c
+++ b/android/hal-handsfree.c
@@ -343,17 +343,36 @@ static bt_status_t disconnect_audio(bt_bdaddr_t *bd_addr)
&cmd, NULL, NULL, NULL);
}
-static bt_status_t start_voice_recognition(void)
+static bt_status_t start_voice_recognition_real(bt_bdaddr_t *bd_addr)
{
+ struct hal_cmd_handsfree_start_vr cmd;
+
DBG("");
if (!interface_ready())
return BT_STATUS_NOT_READY;
+ memset(&cmd, 0, sizeof(cmd));
+
+ if (bd_addr)
+ memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
+
return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, HAL_OP_HANDSFREE_START_VR,
- 0, NULL, NULL, NULL, NULL);
+ sizeof(cmd), &cmd, NULL, NULL, NULL);
}
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+static bt_status_t start_voice_recognition(bt_bdaddr_t *bd_addr)
+{
+ return start_voice_recognition_real(bd_addr);
+}
+#else
+static bt_status_t start_voice_recognition(void)
+{
+ return start_voice_recognition_real(NULL);
+}
+#endif
+
static bt_status_t stop_voice_recognition(void)
{
DBG("");