bluetooth: wait for all profiles to connect before creating card
authorTanu Kaskinen <tanuk@iki.fi>
Sun, 7 Aug 2016 15:45:48 +0000 (18:45 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 10 Aug 2016 18:37:33 +0000 (21:37 +0300)
commitd9b885e0f1d3eafd38b7ff8ff09c31c040d85b47
tree51527387033747268fff921c31c86a5c88c3ea1f
parent74c9549a4240bfc022ab8c7841878004b663bf0c
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.
src/modules/bluetooth/bluez5-util.c
src/modules/bluetooth/bluez5-util.h