iface-modem: consolidate signal quality and access tech polling
Plugins have two ways to update signal quality and access technology values: via unsolicited messages or via polling periodically. Instead of keeping separate contexts for polling signal quality and access technology values, we setup a common timeout to trigger both. This allows us to simplify in which case the explicit update is required, whenever one is needed to be explicitly updated, the other one should also be. The logic now also allows plugins to return an UNSUPPORTED error in either load_signal_quality() and/or load_access_technologies() to tell the interface logic that the polling of the specific item shouldn't be performed (e.g. if the updates are expected via unsolicited messages). If both signal quality and access technology polling is flagged as disabled, we totally disable the polling logic internally. The new SignalCheckContext is bound to the lifetime of the object so that we can keep the value of the supported flags until the object is destroyed.
This commit is contained in:
@@ -853,8 +853,8 @@ allowed_access_technology_update_ready (MMBroadbandModemCinterion *self,
|
||||
if (error)
|
||||
g_task_return_error (task, error);
|
||||
else {
|
||||
/* Request immediate access tech update */
|
||||
mm_iface_modem_refresh_access_technologies (MM_IFACE_MODEM (self));
|
||||
/* Request immediate signal update */
|
||||
mm_iface_modem_refresh_signal (MM_IFACE_MODEM (self));
|
||||
g_task_return_boolean (task, TRUE);
|
||||
}
|
||||
g_object_unref (task);
|
||||
@@ -1140,8 +1140,8 @@ scfg_set_ready (MMBaseModem *self,
|
||||
/* Let the error be critical */
|
||||
g_simple_async_result_take_error (operation_result, error);
|
||||
else {
|
||||
/* Request immediate access tech update */
|
||||
mm_iface_modem_refresh_access_technologies (MM_IFACE_MODEM (self));
|
||||
/* Request immediate signal update */
|
||||
mm_iface_modem_refresh_signal (MM_IFACE_MODEM (self));
|
||||
g_simple_async_result_set_op_res_gboolean (operation_result, TRUE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user