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

committed by
Aleksander Morgado

parent
26be99b8a7
commit
509ba7475a
@@ -1202,51 +1202,51 @@ setup_registration_checks_finish (MMIfaceModemCdma *self,
|
|||||||
{
|
{
|
||||||
SetupRegistrationChecksResults *results;
|
SetupRegistrationChecksResults *results;
|
||||||
|
|
||||||
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
|
results = g_task_propagate_pointer (G_TASK (res), error);
|
||||||
|
if (!results)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
results = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
|
||||||
*skip_qcdm_call_manager_step = results->skip_qcdm_call_manager_step;
|
*skip_qcdm_call_manager_step = results->skip_qcdm_call_manager_step;
|
||||||
*skip_qcdm_hdr_step = results->skip_qcdm_hdr_step;
|
*skip_qcdm_hdr_step = results->skip_qcdm_hdr_step;
|
||||||
*skip_at_cdma_service_status_step = results->skip_at_cdma_service_status_step;
|
*skip_at_cdma_service_status_step = results->skip_at_cdma_service_status_step;
|
||||||
*skip_at_cdma1x_serving_system_step = results->skip_at_cdma1x_serving_system_step;
|
*skip_at_cdma1x_serving_system_step = results->skip_at_cdma1x_serving_system_step;
|
||||||
*skip_detailed_registration_state = results->skip_detailed_registration_state;
|
*skip_detailed_registration_state = results->skip_detailed_registration_state;
|
||||||
|
g_free (results);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parent_setup_registration_checks_ready (MMIfaceModemCdma *self,
|
parent_setup_registration_checks_ready (MMIfaceModemCdma *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GSimpleAsyncResult *simple)
|
GTask *task)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
SetupRegistrationChecksResults results = { 0 };
|
SetupRegistrationChecksResults *results;
|
||||||
|
|
||||||
|
results = g_new0 (SetupRegistrationChecksResults, 1);
|
||||||
if (!iface_modem_cdma_parent->setup_registration_checks_finish (self,
|
if (!iface_modem_cdma_parent->setup_registration_checks_finish (self,
|
||||||
res,
|
res,
|
||||||
&results.skip_qcdm_call_manager_step,
|
&results->skip_qcdm_call_manager_step,
|
||||||
&results.skip_qcdm_hdr_step,
|
&results->skip_qcdm_hdr_step,
|
||||||
&results.skip_at_cdma_service_status_step,
|
&results->skip_at_cdma_service_status_step,
|
||||||
&results.skip_at_cdma1x_serving_system_step,
|
&results->skip_at_cdma1x_serving_system_step,
|
||||||
&results.skip_detailed_registration_state,
|
&results->skip_detailed_registration_state,
|
||||||
&error)) {
|
&error)) {
|
||||||
g_simple_async_result_take_error (simple, error);
|
g_task_return_error (task, error);
|
||||||
|
g_free (results);
|
||||||
} else {
|
} else {
|
||||||
/* Skip +CSS */
|
/* Skip +CSS */
|
||||||
results.skip_at_cdma1x_serving_system_step = TRUE;
|
results->skip_at_cdma1x_serving_system_step = TRUE;
|
||||||
/* Skip +CAD */
|
/* Skip +CAD */
|
||||||
results.skip_at_cdma_service_status_step = TRUE;
|
results->skip_at_cdma_service_status_step = TRUE;
|
||||||
|
|
||||||
/* Force to always use the detailed registration checks, as we have
|
/* Force to always use the detailed registration checks, as we have
|
||||||
* !STATUS for that */
|
* !STATUS for that */
|
||||||
results.skip_detailed_registration_state = FALSE;
|
results->skip_detailed_registration_state = FALSE;
|
||||||
|
|
||||||
g_simple_async_result_set_op_res_gpointer (simple, &results, NULL);
|
g_task_return_pointer (task, results, g_free);
|
||||||
}
|
}
|
||||||
|
g_object_unref (task);
|
||||||
/* All done. NOTE: complete NOT in idle! */
|
|
||||||
g_simple_async_result_complete (simple);
|
|
||||||
g_object_unref (simple);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1254,17 +1254,14 @@ setup_registration_checks (MMIfaceModemCdma *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,
|
|
||||||
setup_registration_checks);
|
|
||||||
|
|
||||||
/* Run parent's checks first */
|
/* Run parent's checks first */
|
||||||
iface_modem_cdma_parent->setup_registration_checks (self,
|
iface_modem_cdma_parent->setup_registration_checks (self,
|
||||||
(GAsyncReadyCallback)parent_setup_registration_checks_ready,
|
(GAsyncReadyCallback)parent_setup_registration_checks_ready,
|
||||||
result);
|
task);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
Reference in New Issue
Block a user