diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c index 3da8c9471..54fa64d8b 100644 --- a/src/modules/bluetooth/backend-native.c +++ b/src/modules/bluetooth/backend-native.c @@ -40,7 +40,7 @@ struct pa_bluetooth_backend { pa_core *core; pa_dbus_connection *connection; pa_bluetooth_discovery *discovery; - bool enable_hs_role; + bool enable_shared_profiles; bool enable_hfp_hf; PA_LLIST_HEAD(pa_dbus_pending, pending); @@ -793,8 +793,8 @@ static void profile_done(pa_bluetooth_backend *b, pa_bluetooth_profile_t profile } } -static void native_backend_apply_profile_registration_change(pa_bluetooth_backend *native_backend, bool enable_hs_role) { - if (enable_hs_role) { +static void native_backend_apply_profile_registration_change(pa_bluetooth_backend *native_backend, bool enable_shared_profiles) { + if (enable_shared_profiles) { profile_init(native_backend, PA_BLUETOOTH_PROFILE_HSP_AG); if (native_backend->enable_hfp_hf) profile_init(native_backend, PA_BLUETOOTH_PROFILE_HFP_HF); @@ -805,17 +805,17 @@ static void native_backend_apply_profile_registration_change(pa_bluetooth_backen } } -void pa_bluetooth_native_backend_enable_hs_role(pa_bluetooth_backend *native_backend, bool enable_hs_role) { +void pa_bluetooth_native_backend_enable_shared_profiles(pa_bluetooth_backend *native_backend, bool enable) { - if (enable_hs_role == native_backend->enable_hs_role) + if (enable == native_backend->enable_shared_profiles) return; - native_backend_apply_profile_registration_change(native_backend, enable_hs_role); + native_backend_apply_profile_registration_change(native_backend, enable); - native_backend->enable_hs_role = enable_hs_role; + native_backend->enable_shared_profiles = enable; } -pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_discovery *y, bool enable_hs_role) { +pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_discovery *y, bool enable_shared_profiles) { pa_bluetooth_backend *backend; DBusError err; @@ -833,10 +833,10 @@ pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_d } backend->discovery = y; - backend->enable_hs_role = enable_hs_role; + backend->enable_shared_profiles = enable_shared_profiles; backend->enable_hfp_hf = pa_bluetooth_discovery_get_enable_native_hfp_hf(y); - if (backend->enable_hs_role) + if (backend->enable_shared_profiles) native_backend_apply_profile_registration_change(backend, true); profile_init(backend, PA_BLUETOOTH_PROFILE_HSP_HS); @@ -849,7 +849,7 @@ void pa_bluetooth_native_backend_free(pa_bluetooth_backend *backend) { pa_dbus_free_pending_list(&backend->pending); - if (backend->enable_hs_role) + if (backend->enable_shared_profiles) native_backend_apply_profile_registration_change(backend, false); profile_done(backend, PA_BLUETOOTH_PROFILE_HSP_HS); diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c index 5f3d651b4..bb31d3ecc 100644 --- a/src/modules/bluetooth/bluez5-util.c +++ b/src/modules/bluetooth/bluez5-util.c @@ -1466,7 +1466,7 @@ void pa_bluetooth_discovery_set_ofono_running(pa_bluetooth_discovery *y, bool is if (y->headset_backend != HEADSET_BACKEND_AUTO) return; - pa_bluetooth_native_backend_enable_hs_role(y->native_backend, !is_running); + pa_bluetooth_native_backend_enable_shared_profiles(y->native_backend, !is_running); /* If ofono starts running, all devices that might be connected to the HS roles or HFP AG role * need to be disconnected, so that the devices can be handled by ofono */ diff --git a/src/modules/bluetooth/bluez5-util.h b/src/modules/bluetooth/bluez5-util.h index 05ad0d05b..a621fa6e0 100644 --- a/src/modules/bluetooth/bluez5-util.h +++ b/src/modules/bluetooth/bluez5-util.h @@ -164,15 +164,15 @@ static inline void pa_bluetooth_ofono_backend_free(pa_bluetooth_backend *b) {} #endif #ifdef HAVE_BLUEZ_5_NATIVE_HEADSET -pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_discovery *y, bool enable_hs_role); +pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_discovery *y, bool enable_shared_profiles); void pa_bluetooth_native_backend_free(pa_bluetooth_backend *b); -void pa_bluetooth_native_backend_enable_hs_role(pa_bluetooth_backend *b, bool enable_hs_role); +void pa_bluetooth_native_backend_enable_shared_profiles(pa_bluetooth_backend *b, bool enable); #else -static inline pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_discovery *y, bool enable_hs_role) { +static inline pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_discovery *y, bool enable_shared_profiles) { return NULL; } static inline void pa_bluetooth_native_backend_free(pa_bluetooth_backend *b) {} -static inline void pa_bluetooth_native_backend_enable_hs_role(pa_bluetooth_backend *b, bool enable_hs_role) {} +static inline void pa_bluetooth_native_backend_enable_shared_profiles(pa_bluetooth_backend *b, bool enable) {} #endif pa_bluetooth_transport *pa_bluetooth_transport_new(pa_bluetooth_device *d, const char *owner, const char *path,