summaryrefslogtreecommitdiffstats
path: root/src/stk.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2012-11-24 07:49:30 -0600
committerDenis Kenzior <denkenz@gmail.com>2012-11-28 10:31:14 -0600
commitb5d7fd8d3823766979f1a1afbec09284c6cf1bb5 (patch)
tree9a3c2acb9034109599ee80ee72f1f752d77cb424 /src/stk.c
parent2eaacefbe03f002d4a8826ade1b17eb8faf82d7b (diff)
downloadofono-b5d7fd8d3823766979f1a1afbec09284c6cf1bb5.tar.bz2
stk: Handle self explanatory icons in idle mode text
Diffstat (limited to 'src/stk.c')
-rw-r--r--src/stk.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/stk.c b/src/stk.c
index 65884c76..68278639 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -975,11 +975,11 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
{
DBusConnection *conn = ofono_dbus_get_connection();
const char *path = __ofono_atom_get_path(stk->atom);
+ const struct stk_command_setup_idle_mode_text *sim =
+ &cmd->setup_idle_mode_text;
char *idle_mode_text;
- idle_mode_text = dbus_apply_text_attributes(
- cmd->setup_idle_mode_text.text,
- &cmd->setup_idle_mode_text.text_attr);
+ idle_mode_text = dbus_apply_text_attributes(sim->text, &sim->text_attr);
if (idle_mode_text == NULL) {
rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
@@ -989,6 +989,10 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
if (stk->idle_mode_text)
g_free(stk->idle_mode_text);
+ if (sim->icon_id.id != 0 && sim->icon_id.qualifier ==
+ STK_ICON_QUALIFIER_TYPE_SELF_EXPLANATORY)
+ idle_mode_text[0]='\0';
+
stk->idle_mode_text = idle_mode_text;
ofono_dbus_signal_property_changed(conn, path, OFONO_STK_INTERFACE,
@@ -996,8 +1000,8 @@ static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
DBUS_TYPE_STRING,
&idle_mode_text);
- if (stk->idle_mode_icon.id != cmd->setup_idle_mode_text.icon_id.id) {
- memcpy(&stk->idle_mode_icon, &cmd->setup_idle_mode_text.icon_id,
+ if (stk->idle_mode_icon.id != sim->icon_id.id) {
+ memcpy(&stk->idle_mode_icon, &sim->icon_id,
sizeof(stk->idle_mode_icon));
ofono_dbus_signal_property_changed(conn, path,