* [PATCH] emulator: Fix for PTS test TC_AG_TWC_BV_02_I
@ 2012-02-28 13:33 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-05 20:01 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2012-02-28 13:33 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2551 bytes --]
RING event should only be sent when callsetup indicator is set to
Incoming and there is no active call.
If call indicator is set to inactive while callsetup is
already set to Incoming (waiting call has generated +CCWA),
RING event should be sent after all calls' state have been updated.
As state of calls are updated one by one, generating multiple calls
to ofono_emulator_set_indicator(), do not call notify_ring() just
after call indicator went from active/held to inactive (only start
ring timer).
In ring_timer(), in case of a call in waiting state, just exit and
wait for next timeout.
---
src/emulator.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/emulator.c b/src/emulator.c
index 262e782..fed699c 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -414,6 +414,13 @@ static gboolean notify_ring(void *user_data)
if (em->type == OFONO_EMULATOR_TYPE_HFP && em->slc == FALSE)
return TRUE;
+ /*
+ * In case of waiting call becoming an incoming call, call status
+ * change may not have been done yet, wait for change has been completed
+ */
+ if (find_call_with_status(em, CALL_STATUS_WAITING))
+ return TRUE;
+
g_at_server_send_unsolicited(em->server, "RING");
if (!em->clip)
@@ -421,13 +428,6 @@ static gboolean notify_ring(void *user_data)
c = find_call_with_status(em, CALL_STATUS_INCOMING);
- /*
- * In case of waiting call becoming an incoming call, call status
- * change may not have been done yet, so try to find waiting call too
- */
- if (c == NULL)
- c = find_call_with_status(em, CALL_STATUS_WAITING);
-
if (c == NULL)
return TRUE;
@@ -1221,10 +1221,10 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
/*
* Ring timer should be started when:
* - callsetup indicator is set to Incoming and there is no active call
- * (not a waiting call)
+ * (not a waiting call), in this case, a first RING should be sent
+ * just after the +CIEV
* - or call indicator is set to inactive while callsetup is already
* set to Incoming.
- * In those cases, a first RING should be sent just after the +CIEV
* Ring timer should be stopped for all other values of callsetup
*/
if (waiting)
@@ -1247,8 +1247,9 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
return;
}
-start_ring:
notify_ring(em);
+
+start_ring:
em->callsetup_source = g_timeout_add_seconds(RING_TIMEOUT,
notify_ring, em);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] emulator: Fix for PTS test TC_AG_TWC_BV_02_I
2012-02-28 13:33 [PATCH] emulator: Fix for PTS test TC_AG_TWC_BV_02_I =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2012-03-05 20:01 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2012-03-05 20:01 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]
Hi Frédéric,
On 02/28/2012 07:33 AM, Frédéric Danis wrote:
> RING event should only be sent when callsetup indicator is set to
> Incoming and there is no active call.
>
> If call indicator is set to inactive while callsetup is
> already set to Incoming (waiting call has generated +CCWA),
> RING event should be sent after all calls' state have been updated.
>
> As state of calls are updated one by one, generating multiple calls
> to ofono_emulator_set_indicator(), do not call notify_ring() just
> after call indicator went from active/held to inactive (only start
> ring timer).
> In ring_timer(), in case of a call in waiting state, just exit and
> wait for next timeout.
> ---
> src/emulator.c | 21 +++++++++++----------
> 1 files changed, 11 insertions(+), 10 deletions(-)
It seems like you're covering up the symptoms, not really addressing the
real issue. The logic we have right now is mostly correct, we're just
not handling the CHLD=1 case properly. Can you try the attached patch
and see if it makes the PTS test case pass?
Regards,
-Denis
[-- Attachment #2: 0001-emulator-Fix-PTS-test-case-TC_AG_TWC_BV_02_I.patch --]
[-- Type: text/plain, Size: 1659 bytes --]
>From 38e0965fb1fd4156f7a3b2578e9a83e528bd3973 Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Mon, 5 Mar 2012 13:58:26 -0600
Subject: [PATCH] emulator: Fix PTS test case TC_AG_TWC_BV_02_I
---
src/emulator.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/emulator.c b/src/emulator.c
index 262e782..3879049 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -420,14 +420,6 @@ static gboolean notify_ring(void *user_data)
return TRUE;
c = find_call_with_status(em, CALL_STATUS_INCOMING);
-
- /*
- * In case of waiting call becoming an incoming call, call status
- * change may not have been done yet, so try to find waiting call too
- */
- if (c == NULL)
- c = find_call_with_status(em, CALL_STATUS_WAITING);
-
if (c == NULL)
return TRUE;
@@ -1219,6 +1211,13 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
}
/*
+ * In case of waiting call becoming an incoming call, call status
+ * change may not have been done yet, so do nothing
+ */
+ if (find_call_with_status(em, CALL_STATUS_WAITING) != NULL)
+ return;
+
+ /*
* Ring timer should be started when:
* - callsetup indicator is set to Incoming and there is no active call
* (not a waiting call)
@@ -1227,8 +1226,6 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
* In those cases, a first RING should be sent just after the +CIEV
* Ring timer should be stopped for all other values of callsetup
*/
- if (waiting)
- return;
/* Call state went from active/held + waiting -> incoming */
if (call && value == OFONO_EMULATOR_CALL_INACTIVE &&
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-05 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28 13:33 [PATCH] emulator: Fix for PTS test TC_AG_TWC_BV_02_I =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-05 20:01 ` 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.