summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Paulo Rechi Vita <jprvita@endlessm.com>2018-09-11 12:57:07 -0700
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>2021-10-06 15:07:00 +0000
commitf7acc2ad7d77c32083f749446a5184ad3f482639 (patch)
tree4e9f0752e7cf3e80bbff3d1e0d1f38cbf6c8f737
parentab47d9394bc00c268ff8b8cb9def4f9ba8ddb311 (diff)
bluetooth: Do not create a card profile for unsupported profiles
Check whether a Bluetooth profile is supported both by the remote device and the local host before creating a card profile for it. This is useful when some of the media profiles have not been registered with bluetoothd because ex., oFono is not running and the headset backend is not available. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/638>
-rw-r--r--src/modules/bluetooth/module-bluez5-device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
index afbb7e3fa..3ceda9713 100644
--- a/src/modules/bluetooth/module-bluez5-device.c
+++ b/src/modules/bluetooth/module-bluez5-device.c
@@ -2198,6 +2198,9 @@ static int add_card(struct userdata *u) {
if (pa_hashmap_get(data.profiles, pa_bluetooth_profile_to_string(profile)))
continue;
+ if (!pa_bluetooth_device_supports_profile(d, profile))
+ continue;
+
cp = create_card_profile(u, profile, data.ports);
pa_hashmap_put(data.profiles, cp->name, cp);
}