From: Luiz Augusto von Dentz Date: Sat, 18 Jul 2020 00:25:52 +0000 (-0700) Subject: device: Fix not removing temporary timer when connected X-Git-Tag: submit/tizen/20210606.232858~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e95db4df30662da02c231ac1eadd1189bb1ffb2;p=platform%2Fupstream%2Fbluez.git 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. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- diff --git a/src/device.c b/src/device.c index 7f287433..9f58ff0e 100644 --- a/src/device.c +++ b/src/device.c @@ -4716,6 +4716,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"); #else