From: Yu Liu Date: Mon, 24 Aug 2020 18:19:03 +0000 (-0700) Subject: adapter: Mark device temporary state pairing failure X-Git-Tag: accepted/tizen/unified/20210607.124421~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4997311d931a524b24f216c2bde12ffc932ce0f3;p=platform%2Fupstream%2Fbluez.git adapter: Mark device temporary state pairing failure This caused the device hanging around as a discovered device forever even if it is turned off or not in present. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- diff --git a/src/device.c b/src/device.c index 2e3a80b..d145a32 100644 --- a/src/device.c +++ b/src/device.c @@ -8588,6 +8588,14 @@ void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type, if (status) { device_cancel_authentication(device, TRUE); + + /* Put the device back to the temporary state so that it will be + * treated as a newly discovered device. + */ + if (!device_is_paired(device, bdaddr_type) && + !device_is_trusted(device)) + btd_device_set_temporary(device, true); + device_bonding_failed(device, status); #ifdef TIZEN_FEATURE_BLUEZ_MODIFY device->legacy_pairing = false;