From cd78003e6611bdceb729a98f1b16caa52b423747 Mon Sep 17 00:00:00 2001 From: Huang-Huang Date: Sun, 7 Feb 2021 04:44:57 +0800 Subject: [PATCH] bluez5: don't create device if there is no connected profile --- spa/plugins/bluez5/bluez5-dbus.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index 61655da5d..e1052b449 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -476,7 +476,7 @@ static int device_add(struct spa_bt_monitor *monitor, struct spa_bt_device *devi struct spa_dict_item items[20]; uint32_t n_items = 0; - if (device->added) + if (device->connected_profiles == 0 || device->added) return 0; info = SPA_DEVICE_OBJECT_INFO_INIT(); @@ -601,8 +601,7 @@ int spa_bt_device_check_profiles(struct spa_bt_device *device, bool force) device_stop_timer(device); device_remove(monitor, device); } - } - else if (force || (device->profiles & connected_profiles) == device->profiles) { + } else if (force || (device->profiles & connected_profiles) == device->profiles) { device_stop_timer(device); device_add(monitor, device); } else {