pa_dbus_connection *connection;
pa_bluetooth_discovery *discovery;
bool enable_shared_profiles;
+ bool enable_hsp_hs;
bool enable_hfp_hf;
PA_LLIST_HEAD(pa_dbus_pending, pending);
backend->discovery = y;
backend->enable_shared_profiles = enable_shared_profiles;
backend->enable_hfp_hf = pa_bluetooth_discovery_get_enable_native_hfp_hf(y);
+ backend->enable_hsp_hs = pa_bluetooth_discovery_get_enable_native_hsp_hs(y);
- profile_init(backend, PA_BLUETOOTH_PROFILE_HSP_HS);
+ if (!backend->enable_hsp_hs && !backend->enable_hfp_hf)
+ pa_log_warn("Both HSP HS and HFP HF bluetooth profiles disabled in native backend. Native backend will not register for headset connections.");
+
+ if (backend->enable_hsp_hs)
+ profile_init(backend, PA_BLUETOOTH_PROFILE_HSP_HS);
if (backend->enable_shared_profiles)
native_backend_apply_profile_registration_change(backend, true);
if (backend->enable_shared_profiles)
native_backend_apply_profile_registration_change(backend, false);
- profile_done(backend, PA_BLUETOOTH_PROFILE_HSP_HS);
+ if (backend->enable_hsp_hs)
+ profile_done(backend, PA_BLUETOOTH_PROFILE_HSP_HS);
pa_dbus_connection_unref(backend->connection);
int headset_backend;
pa_bluetooth_backend *ofono_backend, *native_backend;
PA_LLIST_HEAD(pa_dbus_pending, pending);
+ bool enable_native_hsp_hs;
bool enable_native_hfp_hf;
bool enable_msbc;
};
return NULL;
}
+bool pa_bluetooth_discovery_get_enable_native_hsp_hs(pa_bluetooth_discovery *y)
+{
+ pa_assert(y);
+ pa_assert(PA_REFCNT_VALUE(y) > 0);
+
+ return y->enable_native_hsp_hs;
+}
+
bool pa_bluetooth_discovery_get_enable_native_hfp_hf(pa_bluetooth_discovery *y)
{
pa_assert(y);
A2DP_OBJECT_MANAGER_PATH);
}
-pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c, int headset_backend, bool enable_native_hfp_hf, bool enable_msbc) {
+pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c, int headset_backend, bool enable_native_hsp_hs, bool enable_native_hfp_hf, bool enable_msbc) {
pa_bluetooth_discovery *y;
DBusError err;
DBusConnection *conn;
PA_REFCNT_INIT(y);
y->core = c;
y->headset_backend = headset_backend;
+ y->enable_native_hsp_hs = enable_native_hsp_hs;
y->enable_native_hfp_hf = enable_native_hfp_hf;
y->enable_msbc = enable_msbc;
y->adapters = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL,
#define HEADSET_BACKEND_NATIVE 1
#define HEADSET_BACKEND_AUTO 2
-pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *core, int headset_backend, bool default_profile_hfp, bool enable_msbc);
+pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *core, int headset_backend, bool enable_native_hsp_hs, bool enable_native_hfp_hf, bool enable_msbc);
pa_bluetooth_discovery* pa_bluetooth_discovery_ref(pa_bluetooth_discovery *y);
void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y);
void pa_bluetooth_discovery_set_ofono_running(pa_bluetooth_discovery *y, bool is_running);
+bool pa_bluetooth_discovery_get_enable_native_hsp_hs(pa_bluetooth_discovery *y);
bool pa_bluetooth_discovery_get_enable_native_hfp_hf(pa_bluetooth_discovery *y);
bool pa_bluetooth_discovery_get_enable_msbc(pa_bluetooth_discovery *y);
#endif
"autodetect_mtu=<boolean>"
"enable_msbc=<boolean, enable mSBC support in native and oFono backends, default is true>"
"output_rate_refresh_interval_ms=<interval between attempts to improve output rate in milliseconds>"
+ "enable_native_hsp_hs=<boolean, enable HSP support in native backend>"
"enable_native_hfp_hf=<boolean, enable HFP support in native backend>"
);
"autodetect_mtu",
"enable_msbc",
"output_rate_refresh_interval_ms",
+ "enable_native_hsp_hs",
"enable_native_hfp_hf",
NULL
};
bool autodetect_mtu;
bool enable_msbc;
uint32_t output_rate_refresh_interval_ms;
- bool enable_native_hfp_hf = true;
+ bool enable_native_hsp_hs;
+ bool enable_native_hfp_hf;
pa_assert(m);
if (pa_modargs_get_value_boolean(ma, "enable_msbc", &enable_msbc) < 0) {
pa_log("Invalid boolean value for enable_msbc parameter");
}
+ enable_native_hfp_hf = true;
if (pa_modargs_get_value_boolean(ma, "enable_native_hfp_hf", &enable_native_hfp_hf) < 0) {
pa_log("enable_native_hfp_hf must be true or false");
goto fail;
}
+ enable_native_hsp_hs = !enable_native_hfp_hf;
+ if (pa_modargs_get_value_boolean(ma, "enable_native_hsp_hs", &enable_native_hsp_hs) < 0) {
+ pa_log("enable_native_hsp_hs must be true or false");
+ goto fail;
+ }
output_rate_refresh_interval_ms = DEFAULT_OUTPUT_RATE_REFRESH_INTERVAL_MS;
if (pa_modargs_get_value_u32(ma, "output_rate_refresh_interval_ms", &output_rate_refresh_interval_ms) < 0) {
u->output_rate_refresh_interval_ms = output_rate_refresh_interval_ms;
u->loaded_device_paths = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
- if (!(u->discovery = pa_bluetooth_discovery_get(u->core, headset_backend, enable_native_hfp_hf, enable_msbc)))
+ if (!(u->discovery = pa_bluetooth_discovery_get(u->core, headset_backend, enable_native_hsp_hs, enable_native_hfp_hf, enable_msbc)))
goto fail;
u->device_connection_changed_slot =