broadband-modem-qmi: port oma_accept_network_initiated_session to use GTask
This commit is contained in:
committed by
Aleksander Morgado
parent
76bdaaba3e
commit
311859d60f
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user