summaryrefslogtreecommitdiff
path: root/android/hal-handsfree.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-08-26 16:43:21 +0300
committerSzymon Janc <szymon.janc@tieto.com>2014-08-29 15:49:16 +0200
commit59ba24851fbc859e4161f48ac98bc7c91164328d (patch)
tree810039659d0665811e010464c5718f15e967d19b /android/hal-handsfree.c
parent2c47af011d33eeb3d0a1bf313d3f92bc389fea21 (diff)
downloadbluez-59ba24851fbc859e4161f48ac98bc7c91164328d.tar.gz
android/handsfree: Refactor handle_dial()
Call callback only once.
Diffstat (limited to 'android/hal-handsfree.c')
-rw-r--r--android/hal-handsfree.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/android/hal-handsfree.c b/android/hal-handsfree.c
index 0f5e1d7a6..986e74589 100644
--- a/android/hal-handsfree.c
+++ b/android/hal-handsfree.c
@@ -86,6 +86,7 @@ static void handle_dial(void *buf, uint16_t len, int fd)
{
struct hal_ev_handsfree_dial *ev = buf;
uint16_t num_len = ev->number_len;
+ char *number = NULL;
if (len != sizeof(*ev) + num_len ||
(num_len != 0 && ev->number[num_len - 1] != '\0')) {
@@ -97,9 +98,9 @@ static void handle_dial(void *buf, uint16_t len, int fd)
return;
if (ev->number_len)
- cbs->dial_call_cmd_cb((char *) ev->number);
- else
- cbs->dial_call_cmd_cb(NULL);
+ number = (char *) ev->number;
+
+ cbs->dial_call_cmd_cb(number);
}
static void handle_dtmf(void *buf, uint16_t len, int fd)