summaryrefslogtreecommitdiff
path: root/android/hal-handsfree.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-11-05 16:38:53 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-11-06 12:08:06 +0100
commit5078595df1615b02b7928a8e3ed4a4d4259ea793 (patch)
tree19e72ebdc8c15e803b1b985b7d3e07568eccdf78 /android/hal-handsfree.c
parent66231a25cad3c3f9635183c114e1e24b0c055dc5 (diff)
downloadbluez-5078595df1615b02b7928a8e3ed4a4d4259ea793.tar.gz
android/handsfree: Add support for new API for clcc_response
clcc_response has new parameter bdaddr in new Android API.
Diffstat (limited to 'android/hal-handsfree.c')
-rw-r--r--android/hal-handsfree.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/android/hal-handsfree.c b/android/hal-handsfree.c
index 99485d6f3..dfa37e79b 100644
--- a/android/hal-handsfree.c
+++ b/android/hal-handsfree.c
@@ -631,12 +631,13 @@ static bt_status_t at_response(bthf_at_response_t response, int error)
}
#endif
-static bt_status_t clcc_response(int index, bthf_call_direction_t dir,
+static bt_status_t clcc_response_real(int index, bthf_call_direction_t dir,
bthf_call_state_t state,
bthf_call_mode_t mode,
bthf_call_mpty_type_t mpty,
const char *number,
- bthf_call_addrtype_t type)
+ bthf_call_addrtype_t type,
+ bt_bdaddr_t *bd_addr)
{
char buf[IPC_MTU];
struct hal_cmd_handsfree_clcc_response *cmd = (void *) buf;
@@ -647,6 +648,11 @@ static bt_status_t clcc_response(int index, bthf_call_direction_t dir,
if (!interface_ready())
return BT_STATUS_NOT_READY;
+ memset(cmd, 0, sizeof(*cmd));
+
+ if (bd_addr)
+ memcpy(cmd->bdaddr, bd_addr, sizeof(cmd->bdaddr));
+
cmd->index = index;
cmd->dir = dir;
cmd->state = state;
@@ -668,6 +674,31 @@ static bt_status_t clcc_response(int index, bthf_call_direction_t dir,
len, cmd, NULL, NULL, NULL);
}
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+static bt_status_t clcc_response(int index, bthf_call_direction_t dir,
+ bthf_call_state_t state,
+ bthf_call_mode_t mode,
+ bthf_call_mpty_type_t mpty,
+ const char *number,
+ bthf_call_addrtype_t type,
+ bt_bdaddr_t *bd_addr)
+{
+ return clcc_response_real(index, dir, state, mode, mpty, number, type,
+ bd_addr);
+}
+#else
+static bt_status_t clcc_response(int index, bthf_call_direction_t dir,
+ bthf_call_state_t state,
+ bthf_call_mode_t mode,
+ bthf_call_mpty_type_t mpty,
+ const char *number,
+ bthf_call_addrtype_t type)
+{
+ return clcc_response_real(index, dir, state, mode, mpty, number, type,
+ NULL);
+}
+#endif
+
static bt_status_t phone_state_change(int num_active, int num_held,
bthf_call_state_t state,
const char *number,