mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
bluez5: require adapter before profile connect & after
All exposed bluez devices should have an adapter specified at all times. Adapter-less devices appear in some race conditions in BlueZ interface. Require device has non-null adapter, in all cases before adding any profiles (which exposes the device), and reject BlueZ profile connection attempts in that state. If an adapter gets removed by BlueZ, remove also all its devices, so that device->adapter pointers stay valid.
This commit is contained in:
parent
870cd0136a
commit
f2630ed6fc
4 changed files with 14 additions and 5 deletions
|
|
@ -364,7 +364,7 @@ static DBusHandlerResult ofono_audio_card_found(struct impl *backend, char *path
|
|||
}
|
||||
|
||||
d = spa_bt_device_find_by_address(backend->monitor, remote_address, local_address);
|
||||
if (!d) {
|
||||
if (!d || !d->adapter) {
|
||||
spa_log_error(backend->log, "Device doesn’t exist for %s", path);
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue