Blame SOURCES/v5-1-4-bluetooth-use-consistent-profile-names.patch

e44045
diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c
e44045
index 0f0104d8..f2009bfd 100644
e44045
--- a/src/modules/bluetooth/backend-native.c
e44045
+++ b/src/modules/bluetooth/backend-native.c
e44045
@@ -449,7 +449,7 @@ static void set_speaker_gain(pa_bluetooth_transport *t, uint16_t gain) {
e44045
     /* If we are in the AG role, we send a command to the head set to change
e44045
      * the speaker gain. In the HS role, source and sink are swapped, so
e44045
      * in this case we notify the AG that the microphone gain has changed */
e44045
-    if (t->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT) {
e44045
+    if (t->profile == PA_BLUETOOTH_PROFILE_HSP_HS) {
e44045
         len = sprintf(buf, "\r\n+VGS=%d\r\n", gain);
e44045
         pa_log_debug("RFCOMM >> +VGS=%d", gain);
e44045
     } else {
e44045
@@ -476,7 +476,7 @@ static void set_microphone_gain(pa_bluetooth_transport *t, uint16_t gain) {
e44045
     /* If we are in the AG role, we send a command to the head set to change
e44045
      * the microphone gain. In the HS role, source and sink are swapped, so
e44045
      * in this case we notify the AG that the speaker gain has changed */
e44045
-    if (t->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT) {
e44045
+    if (t->profile == PA_BLUETOOTH_PROFILE_HSP_HS) {
e44045
         len = sprintf(buf, "\r\n+VGM=%d\r\n", gain);
e44045
         pa_log_debug("RFCOMM >> +VGM=%d", gain);
e44045
     } else {
e44045
@@ -509,9 +509,9 @@ static DBusMessage *profile_new_connection(DBusConnection *conn, DBusMessage *m,
e44045
 
e44045
     handler = dbus_message_get_path(m);
e44045
     if (pa_streq(handler, HSP_AG_PROFILE)) {
e44045
-        p = PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT;
e44045
+        p = PA_BLUETOOTH_PROFILE_HSP_HS;
e44045
     } else if (pa_streq(handler, HSP_HS_PROFILE)) {
e44045
-        p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
e44045
+        p = PA_BLUETOOTH_PROFILE_HFP_AG;
e44045
     } else {
e44045
         pa_log_error("Invalid handler");
e44045
         goto fail;
e44045
@@ -626,11 +626,11 @@ static void profile_init(pa_bluetooth_backend *b, pa_bluetooth_profile_t profile
e44045
     pa_assert(b);
e44045
 
e44045
     switch (profile) {
e44045
-        case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
e44045
+        case PA_BLUETOOTH_PROFILE_HSP_HS:
e44045
             object_name = HSP_AG_PROFILE;
e44045
             uuid = PA_BLUETOOTH_UUID_HSP_AG;
e44045
             break;
e44045
-        case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
e44045
+        case PA_BLUETOOTH_PROFILE_HFP_AG:
e44045
             object_name = HSP_HS_PROFILE;
e44045
             uuid = PA_BLUETOOTH_UUID_HSP_HS;
e44045
             break;
e44045
@@ -647,10 +647,10 @@ static void profile_done(pa_bluetooth_backend *b, pa_bluetooth_profile_t profile
e44045
     pa_assert(b);
e44045
 
e44045
     switch (profile) {
e44045
-        case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
e44045
+        case PA_BLUETOOTH_PROFILE_HSP_HS:
e44045
             dbus_connection_unregister_object_path(pa_dbus_connection_get(b->connection), HSP_AG_PROFILE);
e44045
             break;
e44045
-        case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
e44045
+        case PA_BLUETOOTH_PROFILE_HFP_AG:
e44045
             dbus_connection_unregister_object_path(pa_dbus_connection_get(b->connection), HSP_HS_PROFILE);
e44045
             break;
e44045
         default:
e44045
@@ -665,9 +665,9 @@ void pa_bluetooth_native_backend_enable_hs_role(pa_bluetooth_backend *native_bac
e44045
        return;
e44045
 
e44045
    if (enable_hs_role)
e44045
-       profile_init(native_backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
e44045
+       profile_init(native_backend, PA_BLUETOOTH_PROFILE_HFP_AG);
e44045
    else
e44045
-       profile_done(native_backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
e44045
+       profile_done(native_backend, PA_BLUETOOTH_PROFILE_HFP_AG);
e44045
 
e44045
    native_backend->enable_hs_role = enable_hs_role;
e44045
 }
e44045
@@ -693,8 +693,8 @@ pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_d
e44045
     backend->enable_hs_role = enable_hs_role;
e44045
 
e44045
     if (enable_hs_role)
e44045
-       profile_init(backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
e44045
-    profile_init(backend, PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT);
e44045
+       profile_init(backend, PA_BLUETOOTH_PROFILE_HFP_AG);
e44045
+    profile_init(backend, PA_BLUETOOTH_PROFILE_HSP_HS);
e44045
 
e44045
     return backend;
e44045
 }
e44045
@@ -705,8 +705,8 @@ void pa_bluetooth_native_backend_free(pa_bluetooth_backend *backend) {
e44045
     pa_dbus_free_pending_list(&backend->pending);
e44045
 
e44045
     if (backend->enable_hs_role)
e44045
-       profile_done(backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
e44045
-    profile_done(backend, PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT);
e44045
+       profile_done(backend, PA_BLUETOOTH_PROFILE_HFP_AG);
e44045
+    profile_done(backend, PA_BLUETOOTH_PROFILE_HSP_HS);
e44045
 
e44045
     pa_dbus_connection_unref(backend->connection);
e44045
 
e44045
diff --git a/src/modules/bluetooth/backend-ofono.c b/src/modules/bluetooth/backend-ofono.c
e44045
index 2c51497f..85b9c477 100644
e44045
--- a/src/modules/bluetooth/backend-ofono.c
e44045
+++ b/src/modules/bluetooth/backend-ofono.c
e44045
@@ -223,7 +223,7 @@ static void hf_audio_agent_card_found(pa_bluetooth_backend *backend, const char
e44045
     const char *key, *value;
e44045
     struct hf_audio_card *card;
e44045
     pa_bluetooth_device *d;
e44045
-    pa_bluetooth_profile_t p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
e44045
+    pa_bluetooth_profile_t p = PA_BLUETOOTH_PROFILE_HFP_AG;
e44045
 
e44045
     pa_assert(backend);
e44045
     pa_assert(path);
e44045
@@ -257,7 +257,7 @@ static void hf_audio_agent_card_found(pa_bluetooth_backend *backend, const char
e44045
             card->local_address = pa_xstrdup(value);
e44045
         } else if (pa_streq(key, "Type")) {
e44045
             if (pa_streq(value, "gateway"))
e44045
-                p = PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT;
e44045
+                p = PA_BLUETOOTH_PROFILE_HSP_HS;
e44045
         }
e44045
 
e44045
         pa_log_debug("%s: %s", key, value);
e44045
diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
e44045
index c9283232..4470f2ef 100644
e44045
--- a/src/modules/bluetooth/bluez5-util.c
e44045
+++ b/src/modules/bluetooth/bluez5-util.c
e44045
@@ -174,10 +174,10 @@ static bool device_supports_profile(pa_bluetooth_device *device, pa_bluetooth_pr
e44045
             return !!pa_hashmap_get(device->uuids, PA_BLUETOOTH_UUID_A2DP_SINK);
e44045
         case PA_BLUETOOTH_PROFILE_A2DP_SOURCE:
e44045
             return !!pa_hashmap_get(device->uuids, PA_BLUETOOTH_UUID_A2DP_SOURCE);
e44045
-        case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
e44045
+        case PA_BLUETOOTH_PROFILE_HSP_HS:
e44045
             return !!pa_hashmap_get(device->uuids, PA_BLUETOOTH_UUID_HSP_HS)
e44045
                 || !!pa_hashmap_get(device->uuids, PA_BLUETOOTH_UUID_HFP_HF);
e44045
-        case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
e44045
+        case PA_BLUETOOTH_PROFILE_HFP_AG:
e44045
             return !!pa_hashmap_get(device->uuids, PA_BLUETOOTH_UUID_HSP_AG)
e44045
                 || !!pa_hashmap_get(device->uuids, PA_BLUETOOTH_UUID_HFP_AG);
e44045
         case PA_BLUETOOTH_PROFILE_OFF:
e44045
@@ -1018,7 +1018,7 @@ void pa_bluetooth_discovery_set_ofono_running(pa_bluetooth_discovery *y, bool is
e44045
         pa_bluetooth_device *d;
e44045
 
e44045
         PA_HASHMAP_FOREACH(d, y->devices, state) {
e44045
-            if (device_supports_profile(d, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY)) {
e44045
+            if (device_supports_profile(d, PA_BLUETOOTH_PROFILE_HFP_AG)) {
e44045
                 DBusMessage *m;
e44045
 
e44045
                 pa_assert_se(m = dbus_message_new_method_call(BLUEZ_SERVICE, d->path, "org.bluez.Device1", "Disconnect"));
e44045
@@ -1304,9 +1304,9 @@ const char *pa_bluetooth_profile_to_string(pa_bluetooth_profile_t profile) {
e44045
             return "a2dp_sink";
e44045
         case PA_BLUETOOTH_PROFILE_A2DP_SOURCE:
e44045
             return "a2dp_source";
e44045
-        case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
e44045
+        case PA_BLUETOOTH_PROFILE_HSP_HS:
e44045
             return "headset_head_unit";
e44045
-        case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
e44045
+        case PA_BLUETOOTH_PROFILE_HFP_AG:
e44045
             return "headset_audio_gateway";
e44045
         case PA_BLUETOOTH_PROFILE_OFF:
e44045
             return "off";
e44045
diff --git a/src/modules/bluetooth/bluez5-util.h b/src/modules/bluetooth/bluez5-util.h
e44045
index a3e7bf3d..84c0c3f1 100644
e44045
--- a/src/modules/bluetooth/bluez5-util.h
e44045
+++ b/src/modules/bluetooth/bluez5-util.h
e44045
@@ -46,8 +46,8 @@ typedef enum pa_bluetooth_hook {
e44045
 typedef enum profile {
e44045
     PA_BLUETOOTH_PROFILE_A2DP_SINK,
e44045
     PA_BLUETOOTH_PROFILE_A2DP_SOURCE,
e44045
-    PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT,
e44045
-    PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY,
e44045
+    PA_BLUETOOTH_PROFILE_HSP_HS,
e44045
+    PA_BLUETOOTH_PROFILE_HFP_AG,
e44045
     PA_BLUETOOTH_PROFILE_OFF
e44045
 } pa_bluetooth_profile_t;
e44045
 #define PA_BLUETOOTH_PROFILE_COUNT PA_BLUETOOTH_PROFILE_OFF
e44045
diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
e44045
index 530207a2..d076fbad 100644
e44045
--- a/src/modules/bluetooth/module-bluez5-device.c
e44045
+++ b/src/modules/bluetooth/module-bluez5-device.c
e44045
@@ -257,8 +257,8 @@ static int sco_process_render(struct userdata *u) {
e44045
     pa_memchunk memchunk;
e44045
 
e44045
     pa_assert(u);
e44045
-    pa_assert(u->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT ||
e44045
-                u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
e44045
+    pa_assert(u->profile == PA_BLUETOOTH_PROFILE_HSP_HS ||
e44045
+                u->profile == PA_BLUETOOTH_PROFILE_HFP_AG);
e44045
     pa_assert(u->sink);
e44045
 
e44045
     pa_sink_render_full(u->sink, u->write_block_size, &memchunk);
e44045
@@ -317,8 +317,8 @@ static int sco_process_push(struct userdata *u) {
e44045
     pa_usec_t tstamp = 0;
e44045
 
e44045
     pa_assert(u);
e44045
-    pa_assert(u->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT ||
e44045
-                u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
e44045
+    pa_assert(u->profile == PA_BLUETOOTH_PROFILE_HSP_HS ||
e44045
+                u->profile == PA_BLUETOOTH_PROFILE_HFP_AG);
e44045
     pa_assert(u->source);
e44045
     pa_assert(u->read_smoother);
e44045
 
e44045
@@ -784,7 +784,7 @@ static void transport_release(struct userdata *u) {
e44045
 
e44045
 /* Run from I/O thread */
e44045
 static void transport_config_mtu(struct userdata *u) {
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT || u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY) {
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_HSP_HS || u->profile == PA_BLUETOOTH_PROFILE_HFP_AG) {
e44045
         u->read_block_size = u->read_link_mtu;
e44045
         u->write_block_size = u->write_link_mtu;
e44045
 
e44045
@@ -981,7 +981,7 @@ static void source_set_volume_cb(pa_source *s) {
e44045
     pa_cvolume_set(&s->real_volume, u->sample_spec.channels, volume);
e44045
 
e44045
     /* Set soft volume when in headset role */
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY)
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_HFP_AG)
e44045
         pa_cvolume_set(&s->soft_volume, u->sample_spec.channels, volume);
e44045
 
e44045
     /* If we are in the AG role, we send a command to the head set to change
e44045
@@ -1004,7 +1004,7 @@ static int add_source(struct userdata *u) {
e44045
     data.namereg_fail = false;
e44045
     pa_proplist_sets(data.proplist, "bluetooth.protocol", pa_bluetooth_profile_to_string(u->profile));
e44045
     pa_source_new_data_set_sample_spec(&data, &u->sample_spec);
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT)
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_HSP_HS)
e44045
         pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
e44045
 
e44045
     connect_ports(u, &data, PA_DIRECTION_INPUT);
e44045
@@ -1012,10 +1012,10 @@ static int add_source(struct userdata *u) {
e44045
     if (!u->transport_acquired)
e44045
         switch (u->profile) {
e44045
             case PA_BLUETOOTH_PROFILE_A2DP_SOURCE:
e44045
-            case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
e44045
+            case PA_BLUETOOTH_PROFILE_HFP_AG:
e44045
                 data.suspend_cause = PA_SUSPEND_USER;
e44045
                 break;
e44045
-            case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
e44045
+            case PA_BLUETOOTH_PROFILE_HSP_HS:
e44045
                 /* u->stream_fd contains the error returned by the last transport_acquire()
e44045
                  * EAGAIN means we are waiting for a NewConnection signal */
e44045
                 if (u->stream_fd == -EAGAIN)
e44045
@@ -1039,7 +1039,7 @@ static int add_source(struct userdata *u) {
e44045
     u->source->userdata = u;
e44045
     u->source->parent.process_msg = source_process_msg;
e44045
 
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT || u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY) {
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_HSP_HS || u->profile == PA_BLUETOOTH_PROFILE_HFP_AG) {
e44045
         pa_source_set_set_volume_callback(u->source, source_set_volume_cb);
e44045
         u->source->n_volume_steps = 16;
e44045
     }
e44045
@@ -1151,7 +1151,7 @@ static void sink_set_volume_cb(pa_sink *s) {
e44045
     pa_cvolume_set(&s->real_volume, u->sample_spec.channels, volume);
e44045
 
e44045
     /* Set soft volume when in headset role */
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY)
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_HFP_AG)
e44045
         pa_cvolume_set(&s->soft_volume, u->sample_spec.channels, volume);
e44045
 
e44045
     /* If we are in the AG role, we send a command to the head set to change
e44045
@@ -1174,17 +1174,17 @@ static int add_sink(struct userdata *u) {
e44045
     data.namereg_fail = false;
e44045
     pa_proplist_sets(data.proplist, "bluetooth.protocol", pa_bluetooth_profile_to_string(u->profile));
e44045
     pa_sink_new_data_set_sample_spec(&data, &u->sample_spec);
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT)
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_HSP_HS)
e44045
         pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
e44045
 
e44045
     connect_ports(u, &data, PA_DIRECTION_OUTPUT);
e44045
 
e44045
     if (!u->transport_acquired)
e44045
         switch (u->profile) {
e44045
-            case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
e44045
+            case PA_BLUETOOTH_PROFILE_HFP_AG:
e44045
                 data.suspend_cause = PA_SUSPEND_USER;
e44045
                 break;
e44045
-            case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
e44045
+            case PA_BLUETOOTH_PROFILE_HSP_HS:
e44045
                 /* u->stream_fd contains the error returned by the last transport_acquire()
e44045
                  * EAGAIN means we are waiting for a NewConnection signal */
e44045
                 if (u->stream_fd == -EAGAIN)
e44045
@@ -1210,7 +1210,7 @@ static int add_sink(struct userdata *u) {
e44045
     u->sink->userdata = u;
e44045
     u->sink->parent.process_msg = sink_process_msg;
e44045
 
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT || u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY) {
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_HSP_HS || u->profile == PA_BLUETOOTH_PROFILE_HFP_AG) {
e44045
         pa_sink_set_set_volume_callback(u->sink, sink_set_volume_cb);
e44045
         u->sink->n_volume_steps = 16;
e44045
     }
e44045
@@ -1219,7 +1219,7 @@ static int add_sink(struct userdata *u) {
e44045
 
e44045
 /* Run from main thread */
e44045
 static void transport_config(struct userdata *u) {
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT || u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY) {
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_HSP_HS || u->profile == PA_BLUETOOTH_PROFILE_HFP_AG) {
e44045
         u->sample_spec.format = PA_SAMPLE_S16LE;
e44045
         u->sample_spec.channels = 1;
e44045
         u->sample_spec.rate = 8000;
e44045
@@ -1349,7 +1349,7 @@ static int setup_transport(struct userdata *u) {
e44045
 
e44045
     u->transport = t;
e44045
 
e44045
-    if (u->profile == PA_BLUETOOTH_PROFILE_A2DP_SOURCE || u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY)
e44045
+    if (u->profile == PA_BLUETOOTH_PROFILE_A2DP_SOURCE || u->profile == PA_BLUETOOTH_PROFILE_HFP_AG)
e44045
         transport_acquire(u, true); /* In case of error, the sink/sources will be created suspended */
e44045
     else {
e44045
         int transport_error;
e44045
@@ -1369,8 +1369,8 @@ static pa_direction_t get_profile_direction(pa_bluetooth_profile_t p) {
e44045
     static const pa_direction_t profile_direction[] = {
e44045
         [PA_BLUETOOTH_PROFILE_A2DP_SINK] = PA_DIRECTION_OUTPUT,
e44045
         [PA_BLUETOOTH_PROFILE_A2DP_SOURCE] = PA_DIRECTION_INPUT,
e44045
-        [PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT] = PA_DIRECTION_INPUT | PA_DIRECTION_OUTPUT,
e44045
-        [PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY] = PA_DIRECTION_INPUT | PA_DIRECTION_OUTPUT,
e44045
+        [PA_BLUETOOTH_PROFILE_HSP_HS] = PA_DIRECTION_INPUT | PA_DIRECTION_OUTPUT,
e44045
+        [PA_BLUETOOTH_PROFILE_HFP_AG] = PA_DIRECTION_INPUT | PA_DIRECTION_OUTPUT,
e44045
         [PA_BLUETOOTH_PROFILE_OFF] = 0
e44045
     };
e44045
 
e44045
@@ -1620,7 +1620,7 @@ static int start_thread(struct userdata *u) {
e44045
 
e44045
         /* If we are in the headset role, the sink should not become default
e44045
          * unless there is no other sound device available. */
e44045
-        if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY)
e44045
+        if (u->profile == PA_BLUETOOTH_PROFILE_HFP_AG)
e44045
             u->sink->priority = 1500;
e44045
 
e44045
         pa_sink_put(u->sink);
e44045
@@ -1636,7 +1636,7 @@ static int start_thread(struct userdata *u) {
e44045
         /* If we are in the headset role or the device is an a2dp source,
e44045
          * the source should not become default unless there is no other
e44045
          * sound device available. */
e44045
-        if (u->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY || u->profile == PA_BLUETOOTH_PROFILE_A2DP_SOURCE)
e44045
+        if (u->profile == PA_BLUETOOTH_PROFILE_HFP_AG || u->profile == PA_BLUETOOTH_PROFILE_A2DP_SOURCE)
e44045
             u->source->priority = 1500;
e44045
 
e44045
         pa_source_put(u->source);
e44045
@@ -1873,7 +1873,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, pa_bluetooth_pro
e44045
         p = PA_CARD_PROFILE_DATA(cp);
e44045
         break;
e44045
 
e44045
-    case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
e44045
+    case PA_BLUETOOTH_PROFILE_HSP_HS:
e44045
         cp = pa_card_profile_new(name, _("Headset Head Unit (HSP/HFP)"), sizeof(pa_bluetooth_profile_t));
e44045
         cp->priority = 20;
e44045
         cp->n_sinks = 1;
e44045
@@ -1886,7 +1886,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, pa_bluetooth_pro
e44045
         p = PA_CARD_PROFILE_DATA(cp);
e44045
         break;
e44045
 
e44045
-    case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
e44045
+    case PA_BLUETOOTH_PROFILE_HFP_AG:
e44045
         cp = pa_card_profile_new(name, _("Headset Audio Gateway (HSP/HFP)"), sizeof(pa_bluetooth_profile_t));
e44045
         cp->priority = 20;
e44045
         cp->n_sinks = 1;
e44045
@@ -1961,9 +1961,9 @@ static int uuid_to_profile(const char *uuid, pa_bluetooth_profile_t *_r) {
e44045
     else if (pa_streq(uuid, PA_BLUETOOTH_UUID_A2DP_SOURCE))
e44045
         *_r = PA_BLUETOOTH_PROFILE_A2DP_SOURCE;
e44045
     else if (pa_streq(uuid, PA_BLUETOOTH_UUID_HSP_HS) || pa_streq(uuid, PA_BLUETOOTH_UUID_HFP_HF))
e44045
-        *_r = PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT;
e44045
+        *_r = PA_BLUETOOTH_PROFILE_HSP_HS;
e44045
     else if (pa_streq(uuid, PA_BLUETOOTH_UUID_HSP_AG) || pa_streq(uuid, PA_BLUETOOTH_UUID_HFP_AG))
e44045
-        *_r = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
e44045
+        *_r = PA_BLUETOOTH_PROFILE_HFP_AG;
e44045
     else
e44045
         return -PA_ERR_INVALID;
e44045
 
e44045
@@ -2174,7 +2174,7 @@ static pa_hook_result_t transport_speaker_gain_changed_cb(pa_bluetooth_discovery
e44045
         volume++;
e44045
 
e44045
     pa_cvolume_set(&v, u->sample_spec.channels, volume);
e44045
-    if (t->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT)
e44045
+    if (t->profile == PA_BLUETOOTH_PROFILE_HSP_HS)
e44045
         pa_sink_volume_changed(u->sink, &v);
e44045
     else
e44045
         pa_sink_set_volume(u->sink, &v, true, true);
e44045
@@ -2202,7 +2202,7 @@ static pa_hook_result_t transport_microphone_gain_changed_cb(pa_bluetooth_discov
e44045
 
e44045
     pa_cvolume_set(&v, u->sample_spec.channels, volume);
e44045
 
e44045
-    if (t->profile == PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT)
e44045
+    if (t->profile == PA_BLUETOOTH_PROFILE_HSP_HS)
e44045
         pa_source_volume_changed(u->source, &v);
e44045
     else
e44045
         pa_source_set_volume(u->source, &v, true, true);