diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-07-17 17:25:52 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-07-17 17:46:48 -0700 |
commit | 6ea1b038eedeca31c3796ac921e25509d48d70ec (patch) | |
tree | 6081cbcaf7e6a8c8d8dc9c2c5253ea146fe9994e /src | |
parent | fac14943fa2595f9be8b97b92932f4beb1ae7a75 (diff) | |
download | bluez-6ea1b038eedeca31c3796ac921e25509d48d70ec.tar.gz |
device: Fix not removing temporary timer when connected
Devices with random addresses will not have its temporary flag (as they
cannot be persisted in storage) reset even in case they are connected
which could cause and unintended disconnection.
Diffstat (limited to 'src')
-rw-r--r-- | src/device.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c index 226216235..470596ee4 100644 --- a/src/device.c +++ b/src/device.c @@ -2988,6 +2988,12 @@ void device_add_connection(struct btd_device *dev, uint8_t bdaddr_type) if (dev->le_state.connected && dev->bredr_state.connected) return; + /* Remove temporary timer while connected */ + if (dev->temporary_timer) { + g_source_remove(dev->temporary_timer); + dev->temporary_timer = 0; + } + g_dbus_emit_property_changed(dbus_conn, dev->path, DEVICE_INTERFACE, "Connected"); } |