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



commit 13b3b0e202daf0efcd0751ba40512e23e0de3533
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 d55d747..203d7fe 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"
 };
 
@@ -371,6 +371,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]