1092
static void display_action_cb(DBusPendingCall *call, void *data)
1094
struct stk_agent *agent = data;
1095
stk_agent_display_action_cb cb = agent->user_cb;
1096
DBusMessage *reply = dbus_pending_call_steal_reply(call);
1097
enum stk_agent_result result;
1098
gboolean remove_agent;
1100
if (check_error(agent, reply,
1101
ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) {
1102
remove_agent = TRUE;
1106
if (dbus_message_get_args(reply, NULL, DBUS_TYPE_INVALID) == FALSE) {
1107
ofono_error("Can't parse the reply to DisplayAction()");
1108
remove_agent = TRUE;
1112
cb(result, agent->user_data);
1118
int stk_agent_display_action(struct stk_agent *agent,
1120
const struct stk_icon_id *icon,
1121
stk_agent_display_action_cb cb,
1123
ofono_destroy_func destroy)
1125
DBusConnection *conn = ofono_dbus_get_connection();
1127
agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
1128
OFONO_SIM_APP_INTERFACE,
1130
if (agent->msg == NULL)
1133
dbus_message_append_args(agent->msg,
1134
DBUS_TYPE_STRING, &text,
1135
DBUS_TYPE_BYTE, &icon->id,
1138
if (dbus_connection_send_with_reply(conn, agent->msg, &agent->call,
1139
DBUS_TIMEOUT_INFINITE) == FALSE ||
1140
agent->call == NULL)
1143
agent->user_cb = cb;
1144
agent->user_data = user_data;
1145
agent->user_destroy = destroy;
1147
dbus_pending_call_set_notify(agent->call, display_action_cb,
1153
static void confirm_open_channel_cb(DBusPendingCall *call, void *data)
1155
struct stk_agent *agent = data;
1156
stk_agent_confirmation_cb cb = agent->user_cb;
1157
DBusMessage *reply = dbus_pending_call_steal_reply(call);
1158
enum stk_agent_result result;
1159
gboolean remove_agent;
1160
dbus_bool_t confirm;
1162
if (check_error(agent, reply,
1163
ALLOWED_ERROR_TERMINATE, &result) == -EINVAL) {
1164
remove_agent = TRUE;
1168
if (result != STK_AGENT_RESULT_OK) {
1169
cb(result, FALSE, agent->user_data);
1173
if (dbus_message_get_args(reply, NULL,
1174
DBUS_TYPE_BOOLEAN, &confirm,
1175
DBUS_TYPE_INVALID) == FALSE) {
1176
ofono_error("Can't parse the reply to ConfirmOpenChannel()");
1177
remove_agent = TRUE;
1181
cb(result, confirm, agent->user_data);
1186
int stk_agent_confirm_open_channel(struct stk_agent *agent, const char *text,
1187
const struct stk_icon_id *icon,
1188
stk_agent_confirmation_cb cb,
1190
ofono_destroy_func destroy, int timeout)
1192
DBusConnection *conn = ofono_dbus_get_connection();
1194
agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
1195
OFONO_SIM_APP_INTERFACE,
1196
"ConfirmOpenChannel");
1197
if (agent->msg == NULL)
1200
dbus_message_append_args(agent->msg,
1201
DBUS_TYPE_STRING, &text,
1202
DBUS_TYPE_BYTE, &icon->id,
1205
if (dbus_connection_send_with_reply(conn, agent->msg, &agent->call,
1206
timeout) == FALSE ||
1207
agent->call == NULL)
1210
agent->user_cb = cb;
1211
agent->user_data = user_data;
1212
agent->user_destroy = destroy;
1214
dbus_pending_call_set_notify(agent->call, confirm_open_channel_cb,