Open Source Telephony
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis <frederic.danis@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 1/4] voicecall: Improve transitions check
Date: Fri, 09 Mar 2012 16:26:52 +0100	[thread overview]
Message-ID: <1331306815-13424-1-git-send-email-frederic.danis@linux.intel.com> (raw)

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

Indicators should not be updated if:
- multiple separate calls are active at same time
- a conf call and a call are active at same time
- multiple separate calls are held at same time
- a conf call and a call are held at same time
- a conf call has call in active and held state
---
 src/voicecall.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index c128227..dc4fdf5 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -779,6 +779,8 @@ static void notify_emulator_call_status(struct ofono_voicecall *vc)
 	unsigned int non_mpty = 0;
 	gboolean multiparty = FALSE;
 	gboolean held = FALSE;
+	unsigned int non_mpty_held = 0;
+	gboolean multiparty_held = FALSE;
 	gboolean incoming = FALSE;
 	gboolean dialing = FALSE;
 	gboolean alerting = FALSE;
@@ -805,6 +807,12 @@ static void notify_emulator_call_status(struct ofono_voicecall *vc)
 
 		case CALL_STATUS_HELD:
 			held = TRUE;
+			if (g_slist_find_custom(vc->multiparty_list,
+						GINT_TO_POINTER(v->call->id),
+						call_compare_by_id))
+				multiparty_held = TRUE;
+			else
+				non_mpty_held++;
 			break;
 
 		case CALL_STATUS_DIALING:
@@ -838,6 +846,15 @@ static void notify_emulator_call_status(struct ofono_voicecall *vc)
 	if (waiting && (held == FALSE && call == FALSE))
 		return;
 
+	if (non_mpty > 1 || (non_mpty && multiparty))
+		return;
+
+	if (non_mpty_held > 1 || (non_mpty_held && multiparty_held))
+		return;
+
+	if (multiparty && multiparty_held)
+		return;
+
 	data.status = call || held ? OFONO_EMULATOR_CALL_ACTIVE :
 					OFONO_EMULATOR_CALL_INACTIVE;
 
@@ -864,18 +881,6 @@ 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


             reply	other threads:[~2012-03-09 15:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-09 15:26 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis [this message]
2012-03-09 15:26 ` [PATCH 2/4] emulator: Add API to force indicator event =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-14  2:45   ` Denis Kenzior
2012-03-09 15:26 ` [PATCH 3/4] emulator: Force indicator event implementation =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-14  2:47   ` Denis Kenzior
2012-03-09 15:26 ` [PATCH 4/4] voicecall: Force callheld update after calls swap =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-14  2:44 ` [PATCH 1/4] voicecall: Improve transitions check Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1331306815-13424-1-git-send-email-frederic.danis@linux.intel.com \
    --to=frederic.danis@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox