[gnome-bluetooth] settings: Fix pairing of the PS3 BD remote



commit e166cc4cf2dbe5f6591c9f64588a80cd8dbee6b5
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Dec 9 16:22:07 2013 +0100

    settings: Fix pairing of the PS3 BD remote
    
    Straight after discovery, the legacy pairing might not have
    been detected yet, so go with the information we have to
    detect whether we need to not use pairing.
    
    Fixes an assertion trying to pair the PS3 BD remote.

 lib/bluetooth-settings-widget.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 2855b2d..2e3a8e0 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -823,6 +823,7 @@ start_pairing (BluetoothSettingsWidget *self,
        BluetoothType type;
        char *bdaddr, *name;
        gboolean legacy_pairing;
+       const char *pincode;
 
        g_object_set (G_OBJECT (row), "pairing", TRUE, NULL);
        g_object_get (G_OBJECT (row),
@@ -845,17 +846,15 @@ start_pairing (BluetoothSettingsWidget *self,
 
        g_debug ("Starting pairing for '%s'", name);
 
-       if (legacy_pairing) {
-               const char *pincode;
-
-               pincode = get_pincode_for_device (type,
-                                                 bdaddr,
-                                                 name,
-                                                 NULL,
-                                                 NULL);
-               if (g_strcmp0 (pincode, "NULL") == 0)
-                       pair = FALSE;
-       }
+       /* Legacy pairing might not have been detected yet,
+        * so don't check for it */
+       pincode = get_pincode_for_device (type,
+                                         bdaddr,
+                                         name,
+                                         NULL,
+                                         NULL);
+       if (g_strcmp0 (pincode, "NULL") == 0)
+               pair = FALSE;
 
        g_debug ("About to setup %s (legacy pairing: %d pair: %d)",
                 g_dbus_proxy_get_object_path (proxy),


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