Audio, AudioSink, AudioSource and Control interfaces use "connecting"
instead of "connect in progress" so make the Headset interface consistent
with that.
Some headsets (Nokia HS-12W) connects first on avrcp and only then on hfp
so in case Trusted property is not set this will cause agent_authorize to
return -EBUSY and drop hfp connection.
The proper solution would be to group all connections requests only
sending one authorization so the agent either accept them all or not, but
that would require API changes which we are avoiding right now, so the
current fix only send one connection request which the reponse is used for
the rest of the connections.
In the case that someone calls Adapter.RemoveDevice while we're connected to an
audio profile some function calls could be triggered to manager_get_device.
This patch makes sure these calls don't recreate the device object that was
just removed.
This patch adds logic for automatically connecting both A2DP and HFP profiles
if the headset only connects the other. The feature can be switched off using
the AutoConnect audio.conf parameter.
It's very tricky to get the multiple connected HSP/HFP devices use case right.
E.g. in the case of in-band ringtone the specification mandates us to open SCO
to the HFP before sending RING indications. So, in the case of multiple
connected devices we would have to open multimple simultaneous SCO connections
which simply isn't a wise thing to do.
There's something broken in the "profile enabled" logic at the moment which
makes server_is_enabled return FALSE sometimes when it shouldn't which causes
the necessary interface not to be added to remote device objects. Use simply
the config file values for now since we don't support per-adapter server
configuration anyway.
With this patch drivers can notify the core daemon that a device supports some
UUID. This is useful in case we don't have a service record for a profile which
the remote device initiates a connection for.
If we haven't done SDP yet the data structures will be uninitialized. This
patch makes sure that the structures are properly initialized if we get an
incoming connection before service discovery has been done.
This is needed in preparation of supporting remotely initated audio device
pairing and connections (when we haven't done SDP to the remote device yet).
Due to a kernel bug we can't initiate SCO connections if there's
a server socket bound to the same adapter. Therefore use a global
socket bound to BDADDR_ANY instead.