summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2018-04-28 15:55:05 -0700
committerAleksander Morgado <aleksander@aleksander.es>2018-06-02 17:56:59 +0200
commit311859d60f61ff157f1c6e25d31d618cef3868ed (patch)
tree28407c107fb21fbe514c8f37f494f9f30261cc6d
parent76bdaaba3e0d6e058d0d84b2c61e5581d3c143c1 (diff)
downloadModemManager-311859d60f61ff157f1c6e25d31d618cef3868ed.tar.gz
broadband-modem-qmi: port oma_accept_network_initiated_session to use GTask
-rw-r--r--src/mm-broadband-modem-qmi.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index 0b5b6606f..c7ed59805 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -9373,28 +9373,26 @@ oma_accept_network_initiated_session_finish (MMIfaceModemOma *self,
GAsyncResult *res,
GError **error)
{
- return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
+ return g_task_propagate_boolean (G_TASK (res), error);
}
static void
oma_send_selection_ready (QmiClientOma *client,
GAsyncResult *res,
- GSimpleAsyncResult *simple)
+ GTask *task)
{
QmiMessageOmaSendSelectionOutput *output;
GError *error = NULL;
output = qmi_client_oma_send_selection_finish (client, res, &error);
if (!output || !qmi_message_oma_send_selection_output_get_result (output, &error))
- g_simple_async_result_take_error (simple, error);
+ g_task_return_error (task, error);
else
- g_simple_async_result_set_op_res_gboolean (simple, TRUE);
+ g_task_return_boolean (task, TRUE);
+ g_object_unref (task);
if (output)
qmi_message_oma_send_selection_output_unref (output);
-
- g_simple_async_result_complete (simple);
- g_object_unref (simple);
}
static void
@@ -9407,7 +9405,7 @@ oma_accept_network_initiated_session (MMIfaceModemOma *self,
QmiClient *client = NULL;
QmiMessageOmaSendSelectionInput *input;
- if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self),
+ if (!assure_qmi_client (MM_BROADBAND_MODEM_QMI (self),
QMI_SERVICE_OMA, &client,
callback, user_data))
return;
@@ -9425,10 +9423,7 @@ oma_accept_network_initiated_session (MMIfaceModemOma *self,
5,
NULL,
(GAsyncReadyCallback)oma_send_selection_ready,
- g_simple_async_result_new (G_OBJECT (self),
- callback,
- user_data,
- oma_accept_network_initiated_session));
+ g_task_new (self, NULL, callback, user_data));
qmi_message_oma_send_selection_input_unref (input);
}