summaryrefslogtreecommitdiffstats
path: root/src/stkagent.c
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2010-12-23 05:39:41 +0100
committerDenis Kenzior <denkenz@gmail.com>2010-12-23 18:30:45 -0600
commitc0d584d1601428806c63cd4426bcf4226849e6b2 (patch)
treeff27c83f3df6758009d91bbb2e75bfb29ddf246f /src/stkagent.c
parent369fe6b146175b899a18b62928b74af055d603aa (diff)
downloadofono-c0d584d1601428806c63cd4426bcf4226849e6b2.tar.bz2
stk: Send the AlphaId's to agent
Terminate session if return signature doesn't match but allow agent to return from the call if it does match.
Diffstat (limited to 'src/stkagent.c')
-rw-r--r--src/stkagent.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/stkagent.c b/src/stkagent.c
index e1a6f483..2cdc6e16 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -964,3 +964,52 @@ int stk_agent_loop_tone(struct stk_agent *agent, const char *text,
return 0;
}
+
+static void action_info_cb(DBusPendingCall *call, void *data)
+{
+ struct stk_agent *agent = data;
+ DBusMessage *reply = dbus_pending_call_steal_reply(call);
+ enum stk_agent_result result;
+ gboolean remove_agent;
+
+ if (check_error(agent, reply, 0, &result) == -EINVAL) {
+ remove_agent = TRUE;
+ goto error;
+ }
+
+ if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) {
+ ofono_error("Can't parse the reply to DisplayActionInfo()");
+ remove_agent = TRUE;
+ goto error;
+ }
+
+ goto done;
+
+ CALLBACK_END();
+}
+
+int stk_agent_display_action_info(struct stk_agent *agent, const char *text,
+ const struct stk_icon_id *icon)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_SIM_APP_INTERFACE,
+ "DisplayActionInformation");
+ if (agent->msg == NULL)
+ return -ENOMEM;
+
+ dbus_message_append_args(agent->msg,
+ DBUS_TYPE_STRING, &text,
+ DBUS_TYPE_BYTE, &icon->id,
+ DBUS_TYPE_INVALID);
+
+ if (dbus_connection_send_with_reply(conn, agent->msg, &agent->call,
+ 0) == FALSE ||
+ agent->call == NULL)
+ return -EIO;
+
+ dbus_pending_call_set_notify(agent->call, action_info_cb, agent, NULL);
+
+ return 0;
+}