mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 16:20:09 +01:00
core: don't run Bluetooth disconnect unless the device was connected
Don't unconditionally call disconnect during device deactivation, since the device also gets deactivated in the UNAVAILABLE -> DISCONNECTED state change, long before any Bluetooth connection has been made.
This commit is contained in:
parent
a045c29638
commit
57c99c11fe
1 changed files with 3 additions and 6 deletions
|
|
@ -880,15 +880,11 @@ static void
|
|||
deactivate (NMDevice *device)
|
||||
{
|
||||
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);
|
||||
gboolean dun;
|
||||
|
||||
dun = priv->bt_type == NM_BT_CAPABILITY_DUN;
|
||||
|
||||
priv->have_iface = FALSE;
|
||||
priv->connected = FALSE;
|
||||
|
||||
if (dun) {
|
||||
|
||||
if (priv->bt_type == NM_BT_CAPABILITY_DUN) {
|
||||
if (priv->modem) {
|
||||
nm_modem_deactivate (priv->modem, device);
|
||||
|
||||
|
|
@ -904,7 +900,8 @@ deactivate (NMDevice *device)
|
|||
}
|
||||
}
|
||||
|
||||
nm_bluez_device_disconnect (priv->bt_device);
|
||||
if (priv->bt_type != NM_BT_CAPABILITY_NONE)
|
||||
nm_bluez_device_disconnect (priv->bt_device);
|
||||
|
||||
if (priv->timeout_id) {
|
||||
g_source_remove (priv->timeout_id);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue