bluetooth: Set 'off' profile as default for newly create cards
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 16 Sep 2013 12:10:51 +0000 (15:10 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 16 Oct 2013 10:52:05 +0000 (13:52 +0300)
This makes sure that pa_card_new doesn't select one profile based on
priority which may conflict with audio policy.

src/modules/bluetooth/module-bluez4-device.c
src/modules/bluetooth/module-bluez5-device.c

index 2f4f71e..5925ee5 100644 (file)
@@ -2295,6 +2295,7 @@ static int add_card(struct userdata *u) {
     d = PA_CARD_PROFILE_DATA(p);
     *d = PA_BLUEZ4_PROFILE_OFF;
     pa_hashmap_put(data.profiles, p->name, p);
+    pa_card_new_data_set_profile(&data, "off");
 
     if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
         if (pa_hashmap_get(data.profiles, default_profile))
index e24da2a..0fceaf4 100644 (file)
@@ -1888,6 +1888,7 @@ static int add_card(struct userdata *u) {
     p = PA_CARD_PROFILE_DATA(cp);
     *p = PA_BLUETOOTH_PROFILE_OFF;
     pa_hashmap_put(data.profiles, cp->name, cp);
+    pa_card_new_data_set_profile(&data, "off");
 
     u->card = pa_card_new(u->core, &data);
     pa_card_new_data_done(&data);