bluetooth: prefer headset HFP HF connection with native backend

When HFP HF support is enabled in native backend, peer HFP HF profile connection
is preferred over same peer HSP HS profile connection if peer supports both
profiles.

Enforce the preference by rejecting HSP HS profile connections from such peer.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/491>
This commit is contained in:
Igor V. Kovalenko 2021-01-29 09:28:36 +03:00 committed by Igor Kovalenko
parent 70171158ee
commit 815dd2d627
2 changed files with 10 additions and 10 deletions

View file

@ -2103,16 +2103,6 @@ static int add_card(struct userdata *u) {
PA_HASHMAP_FOREACH(uuid, d->uuids, state) {
pa_bluetooth_profile_t profile;
if (!enable_native_hfp_hf && pa_streq(uuid, PA_BLUETOOTH_UUID_HFP_HF)) {
pa_log_info("device supports HFP but disabling profile as requested");
continue;
}
if (has_both && pa_streq(uuid, PA_BLUETOOTH_UUID_HSP_HS)) {
pa_log_info("device support HSP and HFP, selecting HFP only");
continue;
}
if (uuid_to_profile(uuid, &profile) < 0)
continue;