iface-modem: if bands, capabilities or modes change, refresh signal

We also remove the explicit refresh request from the Cinterion plugin,
as this is a generic action applicable to all modems that require
polling for signal quality and/or access technology.
This commit is contained in:
Aleksander Morgado
2017-05-30 20:09:56 +02:00
parent 8ad868cea2
commit 2c19b1f778
2 changed files with 15 additions and 11 deletions

View File

@@ -852,11 +852,8 @@ allowed_access_technology_update_ready (MMBroadbandModemCinterion *self,
mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
if (error)
g_task_return_error (task, error);
else {
/* Request immediate signal update */
mm_iface_modem_refresh_signal (MM_IFACE_MODEM (self));
else
g_task_return_boolean (task, TRUE);
}
g_object_unref (task);
}
@@ -1139,11 +1136,8 @@ scfg_set_ready (MMBaseModem *self,
if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error))
/* Let the error be critical */
g_simple_async_result_take_error (operation_result, error);
else {
/* Request immediate signal update */
mm_iface_modem_refresh_signal (MM_IFACE_MODEM (self));
else
g_simple_async_result_set_op_res_gboolean (operation_result, TRUE);
}
g_simple_async_result_complete (operation_result);
g_object_unref (operation_result);

View File

@@ -2058,8 +2058,12 @@ set_current_capabilities_ready (MMIfaceModem *self,
if (!MM_IFACE_MODEM_GET_INTERFACE (self)->set_current_capabilities_finish (self, res, &error))
g_dbus_method_invocation_take_error (ctx->invocation, error);
else
else {
/* Capabilities updated: explicitly refresh signal and access technology */
mm_iface_modem_refresh_signal (self);
mm_gdbus_modem_complete_set_current_capabilities (ctx->skeleton, ctx->invocation);
}
handle_set_current_capabilities_context_free (ctx);
}
@@ -2436,8 +2440,11 @@ handle_set_current_bands_ready (MMIfaceModem *self,
if (!mm_iface_modem_set_current_bands_finish (self, res, &error))
g_dbus_method_invocation_take_error (ctx->invocation, error);
else
else {
/* Bands updated: explicitly refresh signal and access technology */
mm_iface_modem_refresh_signal (self);
mm_gdbus_modem_complete_set_current_bands (ctx->skeleton, ctx->invocation);
}
handle_set_current_bands_context_free (ctx);
}
@@ -2752,8 +2759,11 @@ handle_set_current_modes_ready (MMIfaceModem *self,
if (!mm_iface_modem_set_current_modes_finish (self, res, &error))
g_dbus_method_invocation_take_error (ctx->invocation, error);
else
else {
/* Modes updated: explicitly refresh signal and access technology */
mm_iface_modem_refresh_signal (self);
mm_gdbus_modem_complete_set_current_modes (ctx->skeleton, ctx->invocation);
}
handle_set_current_modes_context_free (ctx);
}