From: Anupam Roy Date: Mon, 14 Sep 2020 05:24:17 +0000 (+0530) Subject: Dont remove connected device at discovery cleanup X-Git-Tag: accepted/tizen/6.0/unified/20201030.105054~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F244011%2F1;p=platform%2Fupstream%2Fbluez.git 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 --- 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); }