Message ID | 20210312105206.22534-1-frederic.danis@collabora.com |
---|---|
State | New |
Headers | show |
Series | [BlueZ] adapter: Fix discovery trigger for 0 second delay | expand |
diff --git a/src/adapter.c b/src/adapter.c index cc0849f99..daa4c18b7 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1797,6 +1797,12 @@ static void trigger_start_discovery(struct btd_adapter *adapter, guint delay) if (!btd_adapter_get_powered(adapter)) return; + if (!delay) { + adapter->discovery_idle_timeout = g_idle_add(start_discovery_timeout, + adapter); + return; + } + adapter->discovery_idle_timeout = g_timeout_add_seconds(delay, start_discovery_timeout, adapter); }