Hi Philippe,
On 14 April 2011 14:40, Philippe Nunes <philippe.nunes(a)linux.intel.com> wrote:
---
src/stk.c | 27 ++-------------------------
1 files changed, 2 insertions(+), 25 deletions(-)
diff --git a/src/stk.c b/src/stk.c
index c86cbfb..8214b65 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -128,6 +128,7 @@ static int stk_respond(struct ofono_stk *stk, struct stk_response
*rsp,
stk_command_free(stk->pending_cmd);
stk->pending_cmd = NULL;
stk->cancel_cmd = NULL;
+ stk->respond_on_exit = FALSE;
stk->driver->terminal_response(stk, tlv_len, tlv, cb, stk);
Overall this looks good.
@@ -477,10 +478,8 @@ static void user_termination_cb(enum
stk_agent_result result, void *user_data)
{
struct ofono_stk *stk = user_data;
- if (result == STK_AGENT_RESULT_TERMINATE) {
- stk->respond_on_exit = FALSE;
+ if (result == STK_AGENT_RESULT_TERMINATE)
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
- }
}
static void stk_alpha_id_set(struct ofono_stk *stk,
@@ -598,7 +597,6 @@ static void default_agent_notify(gpointer user_data)
stk->default_agent = NULL;
stk->current_agent = stk->session_agent;
- stk->respond_on_exit = FALSE;
}
static void session_agent_notify(gpointer user_data)
@@ -617,7 +615,6 @@ static void session_agent_notify(gpointer user_data)
stk->session_agent = NULL;
stk->current_agent = stk->default_agent;
- stk->respond_on_exit = FALSE;
if (stk->remove_agent_source) {
g_source_remove(stk->remove_agent_source);
@@ -1159,8 +1156,6 @@ static void request_selection_cb(enum stk_agent_result result,
uint8_t id,
{
struct ofono_stk *stk = user_data;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_OK:
{
@@ -1243,8 +1238,6 @@ static void display_text_cb(enum stk_agent_result result, void
*user_data)
static unsigned char screen_busy_result[] = { 0x01 };
static struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
- stk->respond_on_exit = FALSE;
-
/*
* There are four possible paths for DisplayText with immediate
* response flag set:
@@ -1386,8 +1379,6 @@ static void request_confirmation_cb(enum stk_agent_result result,
struct stk_command_get_inkey *cmd = &stk->pending_cmd->get_inkey;
struct stk_response rsp;
- stk->respond_on_exit = FALSE;
@@ -1442,8 +1433,6 @@ static void request_key_cb(enum stk_agent_result result, char
*string,
struct stk_command_get_inkey *cmd = &stk->pending_cmd->get_inkey;
struct stk_response rsp;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_OK:
memset(&rsp, 0, sizeof(rsp));
@@ -1560,8 +1549,6 @@ static void request_string_cb(enum stk_agent_result result, char
*string,
gboolean packed = (qualifier & (1 << 3)) != 0;
struct stk_response rsp;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_OK:
memset(&rsp, 0, sizeof(rsp));
@@ -1699,8 +1686,6 @@ static void confirm_call_cb(enum stk_agent_result result, gboolean
confirm,
struct stk_response rsp;
int err;
- stk->respond_on_exit = FALSE;
However there's a change in behaviour here which I think is incorrect.
We need to wait for the call to be cancelled or connected before
responding, so I'd just leave this line as is.
Best regards