From 6ea1b038eedeca31c3796ac921e25509d48d70ec Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 17 Jul 2020 17:25:52 -0700 Subject: [PATCH] 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. --- src/device.c | 6 ++++++ 1 file changed, 6 insertions(+) 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"); } -- 2.47.3