device: Fix Pair method not setting auto_connect

Due to commit 507ba12483 ("profile: Remove probe_on_discover")
disable_auto_connect may be set when a service is probed but the device
is still temporary which is normally the result of service being
discovered over advertisement rather than connection.

To fix this the Device.Pair method needs to check if the
disable_auto_connect flag has been set and then reset it set auto_connect
which is similar to how Device.Connect works.
This commit is contained in:
Luiz Augusto von Dentz 2024-08-29 16:12:25 -04:00
parent 2daddeada0
commit 3946757820

View File

@ -3114,6 +3114,11 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg,
* this in the ATT connect callback)
*/
if (bdaddr_type != BDADDR_BREDR) {
if (device->disable_auto_connect) {
device->disable_auto_connect = FALSE;
device_set_auto_connect(device, TRUE);
}
if (!state->connected && btd_le_connect_before_pairing())
err = device_connect_le(device);
else