* [PATCH] android/handsfree: Refactor handle_dial()
@ 2014-08-26 13:43 Andrei Emeltchenko
2014-08-29 13:58 ` Szymon Janc
0 siblings, 1 reply; 2+ messages in thread
From: Andrei Emeltchenko @ 2014-08-26 13:43 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Call callback only once.
---
android/hal-handsfree.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/android/hal-handsfree.c b/android/hal-handsfree.c
index 0f5e1d7..986e745 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)
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] android/handsfree: Refactor handle_dial()
2014-08-26 13:43 [PATCH] android/handsfree: Refactor handle_dial() Andrei Emeltchenko
@ 2014-08-29 13:58 ` Szymon Janc
0 siblings, 0 replies; 2+ messages in thread
From: Szymon Janc @ 2014-08-29 13:58 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
Hi Andrei,
On Tuesday 26 of August 2014 16:43:21 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> Call callback only once.
> ---
> android/hal-handsfree.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/android/hal-handsfree.c b/android/hal-handsfree.c
> index 0f5e1d7..986e745 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)
Patch applied. Thanks.
--
Best regards,
Szymon Janc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-29 13:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-26 13:43 [PATCH] android/handsfree: Refactor handle_dial() Andrei Emeltchenko
2014-08-29 13:58 ` Szymon Janc
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.