Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] android/handsfree: Fix not sending proper call hold status
@ 2015-02-20 10:26 Mariusz Skamra
  2015-02-20 10:26 ` [PATCH 2/2] android/handsfree: Fix SCO disconnection while dialing Mariusz Skamra
  2015-02-20 12:29 ` [PATCH 1/2] android/handsfree: Fix not sending proper call hold status Szymon Janc
  0 siblings, 2 replies; 4+ messages in thread
From: Mariusz Skamra @ 2015-02-20 10:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Mariusz Skamra

This patch fixes not sending callheld=1 +CIEV to HF in lollipop after
active/held calls swapping.

Fixed TC: TC_AG_ECS_BV_03_I, TC_AG_TWC_BV_03_I, TC_AG_TWC_BV_04_I
---
 android/handsfree.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/android/handsfree.c b/android/handsfree.c
index b7aa1dd..f4d6cf0 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
@@ -2304,6 +2304,9 @@ static void phone_state_incoming(struct hf_device *dev, int num_active,
 	if (dev->setup_state == HAL_HANDSFREE_CALL_STATE_INCOMING) {
 		if (dev->num_active != num_active ||
 						dev->num_held != num_held) {
+			if (dev->num_active == num_held &&
+						dev->num_held == num_active)
+				return;
 			/*
 			 * calls changed while waiting call ie. due to
 			 * termination of active call
@@ -2380,11 +2383,11 @@ static void phone_state_idle(struct hf_device *dev, int num_active,
 				connect_audio(dev);
 		}
 
-		if (num_held > dev->num_held)
-			update_indicator(dev, IND_CALLHELD, 1);
-
 		update_indicator(dev, IND_CALLSETUP, 0);
 
+		if (num_held >= dev->num_held && num_held != 0)
+			update_indicator(dev, IND_CALLHELD, 1);
+
 		if (num_active == 0 && num_held == 0 &&
 				num_active == dev->num_active &&
 				num_held == dev->num_held)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] android/handsfree: Fix SCO disconnection while dialing
  2015-02-20 10:26 [PATCH 1/2] android/handsfree: Fix not sending proper call hold status Mariusz Skamra
@ 2015-02-20 10:26 ` Mariusz Skamra
  2015-02-20 15:29   ` Szymon Janc
  2015-02-20 12:29 ` [PATCH 1/2] android/handsfree: Fix not sending proper call hold status Szymon Janc
  1 sibling, 1 reply; 4+ messages in thread
From: Mariusz Skamra @ 2015-02-20 10:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Mariusz Skamra

If we decide to hang up while dialing or alerting, SCO needs to be closed.
Fixes: TC_AG_TCA_BV_04_C
---
 android/handsfree.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/android/handsfree.c b/android/handsfree.c
index f4d6cf0..b0d8058 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
@@ -2403,6 +2403,10 @@ static void phone_state_idle(struct hf_device *dev, int num_active,
 					num_held ? (num_active ? 1 : 2) : 0);
 
 		update_indicator(dev, IND_CALLSETUP, 0);
+
+		/* disconnect SCO if we hang up while dialing or alerting */
+		if (num_active == 0 && num_held == 0)
+			disconnect_sco(dev);
 		break;
 	case HAL_HANDSFREE_CALL_STATE_IDLE:
 		if (dev->call_hanging_up) {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] android/handsfree: Fix not sending proper call hold status
  2015-02-20 10:26 [PATCH 1/2] android/handsfree: Fix not sending proper call hold status Mariusz Skamra
  2015-02-20 10:26 ` [PATCH 2/2] android/handsfree: Fix SCO disconnection while dialing Mariusz Skamra
@ 2015-02-20 12:29 ` Szymon Janc
  1 sibling, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2015-02-20 12:29 UTC (permalink / raw)
  To: Mariusz Skamra; +Cc: linux-bluetooth

Hi Mariusz,

On Friday 20 of February 2015 11:26:25 Mariusz Skamra wrote:
> This patch fixes not sending callheld=1 +CIEV to HF in lollipop after
> active/held calls swapping.

Patch itself looks OK but I'd really appreciate better commit message.
Ie. what phone_state seq we get on KK and on L. 

> Fixed TC: TC_AG_ECS_BV_03_I, TC_AG_TWC_BV_03_I, TC_AG_TWC_BV_04_I
> ---
>  android/handsfree.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/android/handsfree.c b/android/handsfree.c
> index b7aa1dd..f4d6cf0 100644
> --- a/android/handsfree.c
> +++ b/android/handsfree.c
> @@ -2304,6 +2304,9 @@ static void phone_state_incoming(struct hf_device *dev, int num_active,
>  	if (dev->setup_state == HAL_HANDSFREE_CALL_STATE_INCOMING) {
>  		if (dev->num_active != num_active ||
>  						dev->num_held != num_held) {
> +			if (dev->num_active == num_held &&
> +						dev->num_held == num_active)
> +				return;
>  			/*
>  			 * calls changed while waiting call ie. due to
>  			 * termination of active call
> @@ -2380,11 +2383,11 @@ static void phone_state_idle(struct hf_device *dev, int num_active,
>  				connect_audio(dev);
>  		}
>  
> -		if (num_held > dev->num_held)
> -			update_indicator(dev, IND_CALLHELD, 1);
> -
>  		update_indicator(dev, IND_CALLSETUP, 0);
>  
> +		if (num_held >= dev->num_held && num_held != 0)
> +			update_indicator(dev, IND_CALLHELD, 1);
> +
>  		if (num_active == 0 && num_held == 0 &&
>  				num_active == dev->num_active &&
>  				num_held == dev->num_held)
> 

-- 
Best regards, 
Szymon Janc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] android/handsfree: Fix SCO disconnection while dialing
  2015-02-20 10:26 ` [PATCH 2/2] android/handsfree: Fix SCO disconnection while dialing Mariusz Skamra
@ 2015-02-20 15:29   ` Szymon Janc
  0 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2015-02-20 15:29 UTC (permalink / raw)
  To: Mariusz Skamra; +Cc: linux-bluetooth

Hi Mariusz,

On Friday 20 of February 2015 11:26:26 Mariusz Skamra wrote:
> If we decide to hang up while dialing or alerting, SCO needs to be closed.
> Fixes: TC_AG_TCA_BV_04_C
> ---
>  android/handsfree.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/android/handsfree.c b/android/handsfree.c
> index f4d6cf0..b0d8058 100644
> --- a/android/handsfree.c
> +++ b/android/handsfree.c
> @@ -2403,6 +2403,10 @@ static void phone_state_idle(struct hf_device *dev, int num_active,
>  					num_held ? (num_active ? 1 : 2) : 0);
>  
>  		update_indicator(dev, IND_CALLSETUP, 0);
> +
> +		/* disconnect SCO if we hang up while dialing or alerting */
> +		if (num_active == 0 && num_held == 0)
> +			disconnect_sco(dev);
>  		break;
>  	case HAL_HANDSFREE_CALL_STATE_IDLE:
>  		if (dev->call_hanging_up) {
> 

This patch is now applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-20 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-20 10:26 [PATCH 1/2] android/handsfree: Fix not sending proper call hold status Mariusz Skamra
2015-02-20 10:26 ` [PATCH 2/2] android/handsfree: Fix SCO disconnection while dialing Mariusz Skamra
2015-02-20 15:29   ` Szymon Janc
2015-02-20 12:29 ` [PATCH 1/2] android/handsfree: Fix not sending proper call hold status Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox