All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] voicecall: fix callheld indicator for PTS
@ 2011-07-19 16:10 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
  2011-07-19 16:19 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-07-19 16:10 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2558 bytes --]

Fix PTS test TP/TWC/BV-03-I [Call Waiting- Hold Active/Retrieve
Waiting Call or Held].

PTS test fails after receiving intermediate update of callheld indicator
with value 0 (no held call) before it receives update to value 1
(active and held calls). This is due to the non-atomic update of calls
status after call swap (moving first call to active state before moving
second one to hold state).

HFP 1.5 spec specifies that an update of callheld indicator to 1 should
be sent after AT+CHLD=2 command.
As oFono emulator sends +CIEV only if the indicator value changes, we
need to use an intermediate state for callheld indicator (2, all calls on
hold).

So, in case of multiple active calls, or an active call with an active
mutiparty call, force update of callheld indicator to 2.
---
 src/voicecall.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 3646951..ce975d3 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -734,6 +734,8 @@ static void notify_emulator_call_status(struct ofono_voicecall *vc)
 {
 	struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
 	gboolean call = FALSE;
+	unsigned int non_mpty = 0;
+	gboolean multiparty = FALSE;
 	gboolean held = FALSE;
 	gboolean incoming = FALSE;
 	gboolean dialing = FALSE;
@@ -751,6 +753,12 @@ static void notify_emulator_call_status(struct ofono_voicecall *vc)
 		switch (v->call->status) {
 		case CALL_STATUS_ACTIVE:
 			call = TRUE;
+			if (g_slist_find_custom(vc->multiparty_list,
+						GINT_TO_POINTER(v->call->id),
+						call_compare_by_id))
+				multiparty = TRUE;
+			else
+				non_mpty++;
 			break;
 
 		case CALL_STATUS_HELD:
@@ -801,6 +809,18 @@ static void notify_emulator_call_status(struct ofono_voicecall *vc)
 	if (held)
 		data.status = call ? OFONO_EMULATOR_CALLHELD_MULTIPLE :
 					OFONO_EMULATOR_CALLHELD_ON_HOLD;
+	else if (non_mpty > 1 || (non_mpty && multiparty))
+		/*
+		 * After call swap, it is possible that all calls move
+		 * temporarily to active state (depending on call state update
+		 * order), generating an update of callheld indicator to 0.
+		 * This will fail PTS test TP/TWC/BV-03-I.
+		 *
+		 * So, in case of multiple active calls, or an active call with
+		 * an active mutiparty call, force update of callheld indicator
+		 * to 2 (intermediate state allowed).
+		 */
+		data.status = OFONO_EMULATOR_CALLHELD_ON_HOLD;
 	else
 		data.status = OFONO_EMULATOR_CALLHELD_NONE;
 
-- 
1.7.1


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

* Re: [PATCH v2] voicecall: fix callheld indicator for PTS
  2011-07-19 16:10 [PATCH v2] voicecall: fix callheld indicator for PTS =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2011-07-19 16:19 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-07-19 16:19 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

Hi Frédéric,

On 07/19/2011 11:10 AM, Frédéric Danis wrote:
> Fix PTS test TP/TWC/BV-03-I [Call Waiting- Hold Active/Retrieve
> Waiting Call or Held].
> 
> PTS test fails after receiving intermediate update of callheld indicator
> with value 0 (no held call) before it receives update to value 1
> (active and held calls). This is due to the non-atomic update of calls
> status after call swap (moving first call to active state before moving
> second one to hold state).
> 
> HFP 1.5 spec specifies that an update of callheld indicator to 1 should
> be sent after AT+CHLD=2 command.
> As oFono emulator sends +CIEV only if the indicator value changes, we
> need to use an intermediate state for callheld indicator (2, all calls on
> hold).
> 
> So, in case of multiple active calls, or an active call with an active
> mutiparty call, force update of callheld indicator to 2.
> ---
>  src/voicecall.c |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2011-07-19 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-19 16:10 [PATCH v2] voicecall: fix callheld indicator for PTS =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-07-19 16:19 ` Denis Kenzior

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.