From 102d01e6808964b75fbb782c340d33a855f17bf6 Mon Sep 17 00:00:00 2001 From: Anupam Roy Date: Mon, 14 Sep 2020 10:54:17 +0530 Subject: [PATCH] Dont remove connected device at discovery cleanup It is possible that a device is already connected as a temporary device, using a BLE random address. In such situation, adapter should not remove that device during discovry cleanup action. This patch skips removing device if device is already connected. Change-Id: I93dc0003e0b1a6917c6a3d9ebc93f04c89205346 Signed-off-by: Anupam Roy --- src/adapter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index a57dccd..e9ae74b 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2560,7 +2560,12 @@ static void discovery_cleanup(struct btd_adapter *adapter) next = g_slist_next(l); +#ifdef TIZEN_FEATURE_BLUEZ_MODIFY + if (device_is_temporary(dev) && !device_is_connectable(dev) + && !btd_device_is_connected(dev)) +#else if (device_is_temporary(dev) && !device_is_connectable(dev)) +#endif btd_adapter_remove_device(adapter, dev); } -- 2.7.4