broadband-modem: port modem_voice_check_support to use GTask
This commit is contained in:

committed by
Aleksander Morgado

parent
4249792c4e
commit
c270720e94
@@ -6586,28 +6586,26 @@ modem_voice_check_support_finish (MMIfaceModemVoice *self,
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
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
|
static void
|
||||||
ath_format_check_ready (MMBroadbandModem *self,
|
ath_format_check_ready (MMBroadbandModem *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GSimpleAsyncResult *simple)
|
GTask *task)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
|
mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
|
||||||
if (error) {
|
if (error) {
|
||||||
g_simple_async_result_take_error (simple, error);
|
g_task_return_error (task, error);
|
||||||
g_simple_async_result_complete (simple);
|
g_object_unref (task);
|
||||||
g_object_unref (simple);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ATH command is supported; assume we have full voice capabilities */
|
/* ATH command is supported; assume we have full voice capabilities */
|
||||||
g_simple_async_result_set_op_res_gboolean (simple, TRUE);
|
g_task_return_boolean (task, TRUE);
|
||||||
g_simple_async_result_complete (simple);
|
g_object_unref (task);
|
||||||
g_object_unref (simple);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -6615,12 +6613,9 @@ modem_voice_check_support (MMIfaceModemVoice *self,
|
|||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GSimpleAsyncResult *result;
|
GTask *task;
|
||||||
|
|
||||||
result = g_simple_async_result_new (G_OBJECT (self),
|
task = g_task_new (self, NULL, callback, user_data);
|
||||||
callback,
|
|
||||||
user_data,
|
|
||||||
modem_voice_check_support);
|
|
||||||
|
|
||||||
/* We assume that all modems have voice capabilities, but ... */
|
/* We assume that all modems have voice capabilities, but ... */
|
||||||
|
|
||||||
@@ -6630,7 +6625,7 @@ modem_voice_check_support (MMIfaceModemVoice *self,
|
|||||||
3,
|
3,
|
||||||
TRUE,
|
TRUE,
|
||||||
(GAsyncReadyCallback)ath_format_check_ready,
|
(GAsyncReadyCallback)ath_format_check_ready,
|
||||||
result);
|
task);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
Reference in New Issue
Block a user