aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
diff options
context:
space:
mode:
authorDylan Van Assche <me@dylanvanassche.be>2022-04-29 11:56:26 +0200
committerDylan Van Assche <dylan.vanassche@ugent.be>2022-04-29 17:43:10 +0200
commita1b52c14bf9e82f0c680c3476ae52dac105c304e (patch)
tree001e6fa2f6393465219d41fad9eeaf1673c59462 /src/mm-iface-modem.c
parent4d0400b77f38f0d371a8dd018206029756343746 (diff)
mm-iface-modem: set signal quality to 0% on shutdown
If a modem is disabled, the signal quality is still set to the cached value, even though the modem is not connected to any network anymore. Set the signal quality to 0% when the interface is removed from DBus. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/558
Diffstat (limited to 'src/mm-iface-modem.c')
-rw-r--r--src/mm-iface-modem.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 01299301..73d52fca 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -4228,7 +4228,23 @@ mm_iface_modem_disable (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GTask *task;
+ MmGdbusModem *skeleton = NULL;
+ GTask *task;
+
+ g_object_get (self,
+ MM_IFACE_MODEM_DBUS_SKELETON, &skeleton,
+ NULL);
+
+ /*
+ * Set signal quality to 0% and access technologies to unknown since modem is disabled
+ */
+ if (skeleton) {
+ mm_gdbus_modem_set_signal_quality (MM_GDBUS_MODEM (skeleton),
+ g_variant_new ("(ub)", 0, TRUE));
+ mm_gdbus_modem_set_access_technologies (MM_GDBUS_MODEM (skeleton),
+ MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN);
+ g_object_unref (skeleton);
+ }
/* Just complete, nothing to do */
task = g_task_new (self, NULL, callback, user_data);