diff mbox series

[1/2] Set temp if device is bcast source even if addr is private

Message ID 20230830132915.72153-2-silviu.barbulescu@nxp.com
State New
Headers show
Series Set device non temp when synchronized with bcast source | expand

Commit Message

Silviu Florian Barbulescu Aug. 30, 2023, 1:29 p.m. UTC
For audio LE broadcast we need to set the device temporary flag eaven
if the address is private

---
 src/device.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 9b58e0c4e..9ceffa118 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5945,8 +5945,17 @@  void btd_device_set_temporary(struct btd_device *device, bool temporary)
 	if (device->temporary == temporary)
 		return;
 
-	if (device_address_is_private(device))
-		return;
+	if (device_address_is_private(device)) {
+		/* For audio LE broadcast, we need to set the device
+		 * temporary flag even if the address is private.
+		 * If the device that is temporarily set on
+		 * has BCAA_SERVICE_UUID (is a broadcast source)
+		 * will set the temporary flag even if the address
+		 * is private.
+		 */
+		if (!btd_device_has_uuid(device, BCAA_SERVICE_UUID))
+			return;
+	}
 
 	DBG("temporary %d", temporary);