summaryrefslogtreecommitdiffstats
path: root/src/stk.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-04-05 00:16:23 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-04-05 00:16:23 -0500
commit73b9e06c40a6f177d0f20d6d9184b3af52cc02da (patch)
treebea199e2a3b3177d2ca2a67978b2d593167682e2 /src/stk.c
parentd77f0ff79934dca32d77d427962d86d5e6965b36 (diff)
downloadofono-73b9e06c40a6f177d0f20d6d9184b3af52cc02da.tar.bz2
stk: Check for USSD atom before others
For efficiency (and consistency) we should check for the USSD atom before checking CallForwarding, CallBarring, and CallSettings atoms.
Diffstat (limited to 'src/stk.c')
-rw-r--r--src/stk.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/stk.c b/src/stk.c
index 01e14db8..84198e68 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1966,12 +1966,6 @@ static gboolean handle_command_send_ussd(const struct stk_command *cmd,
struct ofono_ussd *ussd;
int err;
- if (ss_is_busy(modem)) {
- ADD_ERROR_RESULT(rsp->result, STK_RESULT_TYPE_TERMINAL_BUSY,
- busy_on_ss_result);
- return TRUE;
- }
-
atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_USSD);
if (atom == NULL || !__ofono_atom_get_registered(atom)) {
rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
@@ -1985,6 +1979,12 @@ static gboolean handle_command_send_ussd(const struct stk_command *cmd,
return TRUE;
}
+ if (ss_is_busy(modem)) {
+ ADD_ERROR_RESULT(rsp->result, STK_RESULT_TYPE_TERMINAL_BUSY,
+ busy_on_ss_result);
+ return TRUE;
+ }
+
err = __ofono_ussd_initiate(ussd, cmd->send_ussd.ussd_string.dcs,
cmd->send_ussd.ussd_string.string,
cmd->send_ussd.ussd_string.len,