diff mbox series

[2/2] Set the device temp false when sync with a bcast source

Message ID 20230830132915.72153-3-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
Set the device temporarily false when sync is done with a broadcast
source so the device will not be removed on the temporary timer

---
 profiles/audio/bap.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index dfc71edf6..ab0b2c22b 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -658,6 +658,9 @@  static void bap_io_close(struct bap_ep *ep)
 	g_io_channel_unref(ep->io);
 	ep->io = NULL;
 	ep->cig_active = false;
+
+	if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SINK)
+		btd_device_set_temporary(ep->data->device, true);
 }
 
 static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg,
@@ -797,6 +800,8 @@  static void iso_bcast_confirm_cb(GIOChannel *io, GError *err, void *user_data)
 		goto drop;
 	}
 
+	btd_device_set_temporary(data->device, false);
+
 	g_io_channel_ref(io);
 	btd_service_connecting_complete(data->service, 0);
 	DBG("BCAST ISO: sync with %s (BIG 0x%02x BIS 0x%02x)",