[gnome-bluetooth/fedora-11] Bug 589681 – Doesn't connect to input service on Sony Ericsson phones



commit 8110b166205759fc0e585573fe226373538df8ec
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Jul 26 20:43:52 2009 +0100

    Bug 589681 â?? Doesn't connect to input service on Sony Ericsson phones
    
    Ignore the Audio service if there's no AudioSink or Headset service.
    
    Makes the input service show up again for Sony Ericsson phones, and
    allows us to connect to the remote control application.

 lib/bluetooth-client.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index d639ba6..e929ad4 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -62,9 +62,9 @@
 #define BLUEZ_DEVICE_INTERFACE	"org.bluez.Device"
 
 static char * detectable_interfaces[] = {
-	"org.bluez.Audio",
 	"org.bluez.Headset",
 	"org.bluez.AudioSink",
+	"org.bluez.Audio",
 	"org.bluez.Input"
 };
 
@@ -370,6 +370,15 @@ device_list_nodes (DBusGProxy *device, BluetoothClient *client, gboolean connect
 		    && g_hash_table_size (table) > 0)
 			continue;
 
+		/* Don't add the audio interface if there's no Headset or AudioSink,
+		 * that means that it could only receive audio */
+		if (g_str_equal (detectable_interfaces[i], BLUEZ_AUDIO_INTERFACE)) {
+			if (g_hash_table_lookup (table, BLUEZ_HEADSET_INTERFACE) == NULL &&
+			    g_hash_table_lookup (table, BLUEZ_AUDIOSINK_INTERFACE) == NULL) {
+				continue;
+			}
+		}
+
 		/* And skip interface if it's already in the hash table */
 		if (g_hash_table_lookup (table, detectable_interfaces[i]) != NULL)
 			continue;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]