hfp_hf_bluez5: Enable WB only with defer_setup
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Thu, 25 Apr 2013 19:05:17 +0000 (16:05 -0300)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 25 Apr 2013 22:51:59 +0000 (17:51 -0500)
When setting the SDP features, only enable wideband speech support if
the kernel has defer setup for SCO.

It is possible that even if defer setup is supported the kernel is
not able to use Transparent Mode for SCO.

plugins/hfp_hf_bluez5.c

index 92385c5edac87a9649fc49ee139e0ceb2242c4e5..7c663b5c82c53ad4510f81fb0af1abcb9637dbae 100644 (file)
@@ -638,8 +638,14 @@ static void connect_handler(DBusConnection *conn, void *user_data)
 {
        uint16_t features = HFP_SDP_HF_FEATURE_3WAY |
                                HFP_SDP_HF_FEATURE_CLIP |
-                               HFP_SDP_HF_FEATURE_REMOTE_VOLUME_CONTROL |
-                               HFP_SDP_HF_FEATURE_WIDEBAND_SPEECH;
+                               HFP_SDP_HF_FEATURE_REMOTE_VOLUME_CONTROL;
+
+       /*
+        * Assuming that if defer_setup is supported, then SCO transparent
+        * mode is also supported
+       */
+       if (ofono_handsfree_audio_has_defer_setup())
+               features |= HFP_SDP_HF_FEATURE_WIDEBAND_SPEECH;
 
        DBG("Registering External Profile handler ...");