Commit 6b5086d4 authored by Bastien Nocera's avatar Bastien Nocera

lib: Fix Discoverable being reset when turned off

Work-around race in bluetoothd which would reset the discoverable
flag if a timeout change was requested before discoverable finished
being set to off:

See https://bugzilla.redhat.com/show_bug.cgi?id=1602985
parent f76e3beb
......@@ -1005,10 +1005,20 @@ _bluetooth_client_set_discoverable (BluetoothClient *client,
if (adapter == NULL)
return FALSE;
g_object_set (adapter,
"discoverable", discoverable,
"discoverable-timeout", timeout,
NULL);
if (discoverable) {
g_object_set (adapter,
"discoverable", discoverable,
"discoverable-timeout", timeout,
NULL);
} else {
/* Work-around race in bluetoothd which would reset the discoverable
* flag if a timeout change was requested before discoverable finished
* being set to off:
* https://bugzilla.redhat.com/show_bug.cgi?id=1602985 */
g_object_set (adapter,
"discoverable", FALSE,
NULL);
}
g_object_unref (adapter);
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment