To let others (PulseAudio) be notified when a handsfree device is
connected with us and can be used for audio routing we need to
expose this by registering a audio card with the correct type.
For devices which are not 'real' phone modems, the voicecall
initialization can happen outside of the pre-sim state. In this case
the voicecall atom detection logic fails. Try to detect the voicecall
atom separately, and register the profile if the SIM atom is already
present and in state 'READY'.
For all other cases, the previous logic still applies.
It was a cause of confusion for little gain to have separate
functions for registering profiles with extra information, for
example "role" and "features". We remove those helper functions
in favor of a single one with more parameters, "role" and
"feature" when NULL, will be ignored.
A watch to G_IO_HUP is added to remove the file descriptor when the
emulator is automatically disconnected when its GAtServer closes.
We use a dupped file descriptor because the events aren't delivered to
the file descriptor who originated them.
This patch renames external profile registration functions replacing the
prefix from 'bluetooth_' to 'bt_' in order to follow the name convention
adopted for bluez5 functions.
This patch adds initial implementation of the D-Bus Profile1
interface and methods responsible for handling Bluetooth connections.
The HFP AG profile interface is registered as soon as a voice capable
modem is registered in oFono.