File 0006-bluetooth-make-native-the-default-backend.patch of Package pulseaudio-modules-bt

From aa29b04a0265c14e8aad1198cbce6be79c8ce3e8 Mon Sep 17 00:00:00 2001
From: James Bottomley <James.Bottomley@HansenPartnership.com>
Date: Thu, 21 Sep 2017 12:29:05 -0700
Subject: [PATCH 6/9] bluetooth: make native the default backend

Change default backend from 'auto' to 'native' so that in the usual
install pulseaudio uses the native backend with HFP_HF handling.

Additionally set default value of enable_native_hfp_hf to false unless
the backend is the native one, in which case the default becomes true,
so that we only bind the HFP_HF end point in the native case (leaving it
free for ofono in the ofono backend or auto case)

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Faidon Liambotis <paravoid@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 src/modules/bluetooth/module-bluez5-discover.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/modules/bluetooth/module-bluez5-discover.c b/src/modules/bluetooth/module-bluez5-discover.c
index bc0a7cc08b0c..26fab87530c0 100644
--- a/src/modules/bluetooth/module-bluez5-discover.c
+++ b/src/modules/bluetooth/module-bluez5-discover.c
@@ -96,7 +96,7 @@ static pa_hook_result_t device_connection_changed_cb(pa_bluetooth_discovery *y,
 }
 
 #ifdef HAVE_BLUEZ_5_NATIVE_HEADSET
-const char *default_headset_backend = "auto";
+const char *default_headset_backend = "native";
 #else
 const char *default_headset_backend = "ofono";
 #endif
@@ -107,7 +107,7 @@ int pa__init(pa_module *m) {
     const char *headset_str, *a2dp_config;
     int headset_backend;
     bool autodetect_mtu;
-    bool enable_native_hfp_hf = true;
+    bool enable_native_hfp_hf;
 
     pa_assert(m);
 
@@ -128,6 +128,9 @@ int pa__init(pa_module *m) {
         goto fail;
     }
 
+    /* default value if no module parameter */
+    enable_native_hfp_hf = (headset_backend == HEADSET_BACKEND_NATIVE);
+
     autodetect_mtu = true;
     if (pa_modargs_get_value_boolean(ma, "autodetect_mtu", &autodetect_mtu) < 0) {
         pa_log("Invalid boolean value for autodetect_mtu parameter");
-- 
2.26.2

openSUSE Build Service is sponsored by