diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-07-30 10:15:07 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-07-30 17:19:56 -0500 |
commit | 27e890cc4094622fff5f49adcea89ca32b73822c (patch) | |
tree | acf6e691d6c7d6e1eb3812451e326b50f289eb56 | |
parent | 2a1eee38bbe3929f6f74d67217bc0618bb4efac8 (diff) | |
download | ofono-27e890cc4094622fff5f49adcea89ca32b73822c.tar.bz2 |
stk: Handle errors when sending to the agent fails
-rw-r--r-- | src/stk.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -1014,9 +1014,14 @@ static gboolean handle_command_select_item(const struct stk_command *cmd, stk->cancel_cmd = stk_request_cancel; - stk_agent_request_selection(stk->current_agent, stk->select_item_menu, + /* We most likely got an out of memory error, tell SIM to retry */ + if (stk_agent_request_selection(stk->current_agent, + stk->select_item_menu, request_menu_cb, stk, - stk->timeout * 1000); + stk->timeout * 1000) < 0) { + rsp->result.type = STK_RESULT_TYPE_TERMINAL_BUSY; + return TRUE; + } return FALSE; } @@ -1091,8 +1096,12 @@ static gboolean handle_command_display_text(const struct stk_command *cmd, stk->cancel_cmd = stk_request_cancel; stk->session_ended = FALSE; - stk_agent_display_text(stk->current_agent, dt->text, 0, priority, - request_text_cb, stk, timeout); + /* We most likely got an out of memory error, tell SIM to retry */ + if (stk_agent_display_text(stk->current_agent, dt->text, 0, priority, + request_text_cb, stk, timeout) < 0) { + rsp->result.type = STK_RESULT_TYPE_TERMINAL_BUSY; + return TRUE; + } return cmd->display_text.immediate_response; } |