diff options
author | Teemu Ikonen <tpikonen@mailbox.org> | 2024-04-07 17:15:32 +0300 |
---|---|---|
committer | Teemu Ikonen <tpikonen@mailbox.org> | 2024-04-07 17:36:29 +0300 |
commit | 008ba03bca3b00223ee3283203268afd45871aa1 (patch) | |
tree | eb06e753e6fcba9cb23c64ee15c519ce338857e8 | |
parent | a118f89241fb47fb36b6fb2efdc0f0706a34f63a (diff) |
Revert "modem-manager: Only disable the given capability in clear_caps()"
mm_modem_location_get_enabled() uses g_dbus_proxy_get_cached_property()
under the hood, so the returned value will not be correct if MM caps are
updated by more than one source close in time.
This can happen for example when a client using both MM GPS and 3G
sources quits. The GPS capability is cleared first, but the update is
not reflected in the cached 'enabled' property. The 3G cap is cleared
next, but it gets an incorrect value from mm_modem_location_get_enabled
and turns the GPS back on.
This reverts commit a9caa550df128bb04f28b3f3c94d909b0d140e15.
-rw-r--r-- | src/gclue-modem-manager.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gclue-modem-manager.c b/src/gclue-modem-manager.c index 88cdc32..54d80e4 100644 --- a/src/gclue-modem-manager.c +++ b/src/gclue-modem-manager.c @@ -665,7 +665,6 @@ clear_caps (GClueModemManager *manager, GCancellable *cancellable, GError **error) { - MMModemLocationSource enabled_caps; GClueModemManagerPrivate *priv; priv = manager->priv; @@ -675,11 +674,8 @@ clear_caps (GClueModemManager *manager, priv->caps &= ~caps; - /* We'll disable only the capability we are told to disable, - * in case there are other programs interacting with ModemManager */ - enabled_caps = mm_modem_location_get_enabled (priv->modem_location); return mm_modem_location_setup_sync (priv->modem_location, - enabled_caps & ~caps, + priv->caps, TRUE, cancellable, error); |