[v5,2/7] bluetooth: policy: Remove BlueZ 4 related code

Submitted by Pali Rohár on Jan. 19, 2019, 5:11 p.m.

Details

Message ID 20190119171156.15810-3-pali.rohar@gmail.com
State New
Series "New API for Bluetooth A2DP codecs"
Headers show

Commit Message

Pali Rohár Jan. 19, 2019, 5:11 p.m.
---
 src/modules/bluetooth/module-bluetooth-policy.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/modules/bluetooth/module-bluetooth-policy.c b/src/modules/bluetooth/module-bluetooth-policy.c
index 4d3126f65..0a6d59d28 100644
--- a/src/modules/bluetooth/module-bluetooth-policy.c
+++ b/src/modules/bluetooth/module-bluetooth-policy.c
@@ -154,10 +154,10 @@  static void card_set_profile(struct userdata *u, pa_card *card, bool revert_to_a
 
         /* Check for correct profile based on revert_to_a2dp */
         if (revert_to_a2dp) {
-            if (!pa_streq(profile->name, "a2dp") && !pa_streq(profile->name, "a2dp_sink"))
+            if (!pa_streq(profile->name, "a2dp_sink"))
                 continue;
         } else {
-            if (!pa_streq(profile->name, "hsp") && !pa_streq(profile->name, "headset_head_unit"))
+            if (!pa_streq(profile->name, "headset_head_unit"))
                 continue;
         }
 
@@ -192,19 +192,19 @@  static void switch_profile(pa_card *card, bool revert_to_a2dp, void *userdata) {
             return;
 
         /* Skip card if does not have active hsp profile */
-        if (!pa_streq(card->active_profile->name, "hsp") && !pa_streq(card->active_profile->name, "headset_head_unit"))
+        if (!pa_streq(card->active_profile->name, "headset_head_unit"))
             return;
 
         /* Skip card if already has active a2dp profile */
-        if (pa_streq(card->active_profile->name, "a2dp") || pa_streq(card->active_profile->name, "a2dp_sink"))
+        if (pa_streq(card->active_profile->name, "a2dp_sink"))
             return;
     } else {
         /* Skip card if does not have active a2dp profile */
-        if (!pa_streq(card->active_profile->name, "a2dp") && !pa_streq(card->active_profile->name, "a2dp_sink"))
+        if (!pa_streq(card->active_profile->name, "a2dp_sink"))
             return;
 
         /* Skip card if already has active hsp profile */
-        if (pa_streq(card->active_profile->name, "hsp") || pa_streq(card->active_profile->name, "headset_head_unit"))
+        if (pa_streq(card->active_profile->name, "headset_head_unit"))
             return;
     }
 
@@ -307,7 +307,6 @@  static pa_hook_result_t card_init_profile_hook_callback(pa_core *c, pa_card *car
 
     /* Ignore card if has already set other initial profile than a2dp */
     if (card->active_profile &&
-        !pa_streq(card->active_profile->name, "a2dp") &&
         !pa_streq(card->active_profile->name, "a2dp_sink"))
         return PA_HOOK_OK;