All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3 v2] audio: Remove profile enabling/disabling logic
@ 2013-03-07  9:41 Luiz Augusto von Dentz
  2013-03-07  9:41 ` [PATCH BlueZ 2/3 v2] audio: Fix not using opposite role for local servers Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2013-03-07  9:41 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This should be handle by the core for all profiles
---
v2: Match only local_uuid to avoid end up disabling both roles whenever one
role is disabled.

 profiles/audio/audio.conf |  4 ---
 profiles/audio/manager.c  | 62 ++++++-----------------------------------------
 2 files changed, 8 insertions(+), 58 deletions(-)

diff --git a/profiles/audio/audio.conf b/profiles/audio/audio.conf
index f556610..067b3fc 100644
--- a/profiles/audio/audio.conf
+++ b/profiles/audio/audio.conf
@@ -6,7 +6,3 @@
 
 # Switch to master role for incoming connections (defaults to true)
 #Master=true
-
-# If we want to disable support for specific services
-# Defaults to supporting the services: Sink, Control
-#Disable=Source
diff --git a/profiles/audio/manager.c b/profiles/audio/manager.c
index 934227e..42a2b58 100644
--- a/profiles/audio/manager.c
+++ b/profiles/audio/manager.c
@@ -70,12 +70,6 @@
 static GKeyFile *config = NULL;
 static GSList *devices = NULL;
 
-static struct enabled_interfaces enabled = {
-	.sink		= TRUE,
-	.source		= FALSE,
-	.control	= TRUE,
-};
-
 static struct audio_device *get_audio_dev(struct btd_device *device)
 {
 	return manager_get_audio_device(device, TRUE);
@@ -410,47 +404,12 @@ void audio_control_disconnected(struct btd_device *dev, int err)
 
 int audio_manager_init(GKeyFile *conf)
 {
-	char **list;
-	int i;
-
-	if (!conf)
-		goto proceed;
-
-	config = conf;
-
-	list = g_key_file_get_string_list(config, "General", "Enable",
-						NULL, NULL);
-	for (i = 0; list && list[i] != NULL; i++) {
-		if (g_str_equal(list[i], "Sink"))
-			enabled.sink = TRUE;
-		else if (g_str_equal(list[i], "Source"))
-			enabled.source = TRUE;
-		else if (g_str_equal(list[i], "Control"))
-			enabled.control = TRUE;
-	}
-	g_strfreev(list);
-
-	list = g_key_file_get_string_list(config, "General", "Disable",
-						NULL, NULL);
-	for (i = 0; list && list[i] != NULL; i++) {
-		if (g_str_equal(list[i], "Sink"))
-			enabled.sink = FALSE;
-		else if (g_str_equal(list[i], "Source"))
-			enabled.source = FALSE;
-		else if (g_str_equal(list[i], "Control"))
-			enabled.control = FALSE;
-	}
-	g_strfreev(list);
+	if (conf)
+		config = conf;
 
-proceed:
-	if (enabled.source)
-		btd_profile_register(&a2dp_source_profile);
-
-	if (enabled.sink)
-		btd_profile_register(&a2dp_sink_profile);
-
-	if (enabled.control)
-		btd_profile_register(&avrcp_profile);
+	btd_profile_register(&a2dp_source_profile);
+	btd_profile_register(&a2dp_sink_profile);
+	btd_profile_register(&avrcp_profile);
 
 	btd_register_adapter_driver(&media_driver);
 
@@ -464,14 +423,9 @@ void audio_manager_exit(void)
 		config = NULL;
 	}
 
-	if (enabled.source)
-		btd_profile_unregister(&a2dp_source_profile);
-
-	if (enabled.sink)
-		btd_profile_unregister(&a2dp_sink_profile);
-
-	if (enabled.control)
-		btd_profile_unregister(&avrcp_profile);
+	btd_profile_unregister(&a2dp_source_profile);
+	btd_profile_unregister(&a2dp_sink_profile);
+	btd_profile_unregister(&avrcp_profile);
 
 	btd_unregister_adapter_driver(&media_driver);
 }
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-07 13:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07  9:41 [PATCH BlueZ 1/3 v2] audio: Remove profile enabling/disabling logic Luiz Augusto von Dentz
2013-03-07  9:41 ` [PATCH BlueZ 2/3 v2] audio: Fix not using opposite role for local servers Luiz Augusto von Dentz
2013-03-07  9:41 ` [PATCH BlueZ 3/3 v2] core: Add DisableProfiles entry to main.conf Luiz Augusto von Dentz
2013-03-07 13:54 ` [PATCH BlueZ 1/3 v2] audio: Remove profile enabling/disabling logic Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.