bluetooth: wait for all profiles to connect before creating card

The CONNECTION_CHANGED hook is used to notify the discovery module
about new and removed devices. When a bluetooth device connects, the
hook used to be called immediately when the first profile connected.
That meant that only one profile was marked as available during the
card creation, other profiles would get marked as available later.

That makes it hard for module-card-restore to restore the saved
profile, if the saved profile becomes available with some delay.
module-card-restore has a workaround for this problem, but that turned
out to interfere with module-bluetooth-policy, so the workaround will
be removed in the next patch.

The BlueZ 4 code doesn't need changes, because we use the
org.bluez.Audio interface to get a notification when all profiles are
connected.
This commit is contained in:
Tanu Kaskinen 2016-08-07 18:45:48 +03:00
parent 74c9549a42
commit d9b885e0f1
2 changed files with 118 additions and 2 deletions

View file

@ -105,6 +105,8 @@ struct pa_bluetooth_device {
pa_hashmap *uuids;
pa_bluetooth_transport *transports[PA_BLUETOOTH_PROFILE_COUNT];
pa_time_event *wait_for_profiles_timer;
};
struct pa_bluetooth_adapter {