diff options
author | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2010-10-13 15:54:12 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-10-14 03:18:28 -0500 |
commit | d9f8b13e18cafd4b8ce6ad139cb910112ad0653b (patch) | |
tree | 16acbd8aa3632578b7a8a7bbe06c8c08951edb42 /src | |
parent | 2059fd289a6739266bf1efeb7b0249f17c235ff1 (diff) | |
download | ofono-d9f8b13e18cafd4b8ce6ad139cb910112ad0653b.tar.bz2 |
stk: Simplify and add icon to alphaId api
The assumption is now that stk_alpha_id_set will handle NULL
or empty alphaIds or icons.
Diffstat (limited to 'src')
-rw-r--r-- | src/stk.c | 25 |
1 files changed, 7 insertions, 18 deletions
@@ -389,7 +389,8 @@ static void emit_menu_changed(struct ofono_stk *stk) g_dbus_send_message(conn, signal); } -static void stk_alpha_id_set(struct ofono_stk *stk, const char *text) +static void stk_alpha_id_set(struct ofono_stk *stk, const char *text, + const struct stk_icon_id *icon) { /* TODO */ } @@ -686,10 +687,6 @@ static void send_sms_cancel(struct ofono_stk *stk) { stk->extern_req->cancelled = TRUE; - if (!stk->pending_cmd->send_sms.alpha_id || - !stk->pending_cmd->send_sms.alpha_id[0]) - return; - stk_alpha_id_unset(stk); } @@ -708,9 +705,7 @@ static void send_sms_submit_cb(gboolean ok, void *data) return; } - if (stk->pending_cmd->send_sms.alpha_id && - stk->pending_cmd->send_sms.alpha_id[0]) - stk_alpha_id_unset(stk); + stk_alpha_id_unset(stk); memset(&rsp, 0, sizeof(rsp)); @@ -759,8 +754,7 @@ static gboolean handle_command_send_sms(const struct stk_command *cmd, stk->cancel_cmd = send_sms_cancel; - if (cmd->send_sms.alpha_id && cmd->send_sms.alpha_id[0]) - stk_alpha_id_set(stk, cmd->send_sms.alpha_id); + stk_alpha_id_set(stk, cmd->send_sms.alpha_id, &cmd->send_sms.icon_id); return FALSE; } @@ -1648,9 +1642,7 @@ static void send_ussd_cancel(struct ofono_stk *stk) if (ussd) __ofono_ussd_initiate_cancel(ussd); - if (stk->pending_cmd->send_ussd.alpha_id && - stk->pending_cmd->send_ussd.alpha_id[0]) - stk_alpha_id_unset(stk); + stk_alpha_id_unset(stk); } static void send_ussd_callback(int error, int dcs, const unsigned char *msg, @@ -1662,9 +1654,7 @@ static void send_ussd_callback(int error, int dcs, const unsigned char *msg, enum sms_charset charset; unsigned char no_cause[] = { 0x00 }; - if (stk->pending_cmd->send_ussd.alpha_id && - stk->pending_cmd->send_ussd.alpha_id[0]) - stk_alpha_id_unset(stk); + stk_alpha_id_unset(stk); memset(&rsp, 0, sizeof(rsp)); @@ -1796,8 +1786,7 @@ static gboolean handle_command_send_ussd(const struct stk_command *cmd, return TRUE; } - if (cmd->send_ussd.alpha_id && cmd->send_ussd.alpha_id[0]) - stk_alpha_id_set(stk, cmd->send_ussd.alpha_id); + stk_alpha_id_set(stk, cmd->send_ussd.alpha_id, &cmd->send_ussd.icon_id); return FALSE; } |