sierra: port modem_after_sim_unlock to use GTask
This commit is contained in:

committed by
Aleksander Morgado

parent
228bd14a11
commit
85915853e5
@@ -909,14 +909,14 @@ modem_after_sim_unlock_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return TRUE;
|
||||
return g_task_propagate_boolean (G_TASK (res), error);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
after_sim_unlock_wait_cb (GSimpleAsyncResult *result)
|
||||
after_sim_unlock_wait_cb (GTask *task)
|
||||
{
|
||||
g_simple_async_result_complete (result);
|
||||
g_object_unref (result);
|
||||
g_task_return_boolean (task, TRUE);
|
||||
g_object_unref (task);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
@@ -925,7 +925,7 @@ modem_after_sim_unlock (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *result;
|
||||
GTask *task;
|
||||
guint timeout = 8;
|
||||
const gchar **drivers;
|
||||
guint i;
|
||||
@@ -941,12 +941,9 @@ modem_after_sim_unlock (MMIfaceModem *self,
|
||||
timeout = 3;
|
||||
}
|
||||
|
||||
result = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
modem_after_sim_unlock);
|
||||
task = g_task_new (self, NULL, callback, user_data);
|
||||
|
||||
g_timeout_add_seconds (timeout, (GSourceFunc)after_sim_unlock_wait_cb, result);
|
||||
g_timeout_add_seconds (timeout, (GSourceFunc)after_sim_unlock_wait_cb, task);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
Reference in New Issue
Block a user