summaryrefslogtreecommitdiffstats
path: root/src/voicecall.c
diff options
context:
space:
mode:
authorFrédéric Danis <frederic.danis@linux.intel.com>2012-03-09 16:26:52 +0100
committerDenis Kenzior <denkenz@gmail.com>2012-03-13 21:44:15 -0500
commit0efaa9975a36b56edd39f6583c2c11a68fdc7f6e (patch)
tree3b2425c49bfa88683df5de2f26cdd7518ed3a84e /src/voicecall.c
parentedd6634fce298b4aed7f2156b98f321db0ed2f38 (diff)
downloadofono-0efaa9975a36b56edd39f6583c2c11a68fdc7f6e.tar.bz2
voicecall: Improve transitions check
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
Diffstat (limited to 'src/voicecall.c')
-rw-r--r--src/voicecall.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index c128227a..dc4fdf51 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;