gdbus: Check for valid path before handling properties
hfpmodem: Refactor voicecall notify with foreach

Define a helper function in order to use foreach statements when
ofono_voicecall_notify() needs to be called.
hfpmodem: Avoid transitional voicecall states

While processing the result of AT+CLCC, process the differences in a way
that disconnections are reported first, then call state changes and
finally new calls.

The goal is to avoid unnecessary transitional states such as two active
calls existing at the same time.
hfpmodem: Fix release-and-swap without +CIEV

Some phones do not send the corresponding call state update (+CIEV)
after a successful release-and-swap operation (AT+CHLD=1).

This has been observed with a Nokia 500, while testing ReleaseAndSwap()
while an active and a held call exist:

ofonod[20414]: > AT+CLCC\r
ofonod[20414]: < \r\n+CLCC: 1,0,1,0,0,"<number1>",145\r\n
ofonod[20414]: < \r\n+CLCC: 2,0,0,0,0,"<number2>",145\r\n
ofonod[20414]: < \r\nOK\r\n
ofonod[20414]: > AT+CHLD=1\r
ofonod[20414]: < \r\nOK\r\n

After this, no +CIEV is received, but the call has been hung up.

The proposed approach to solve this consists of using AT+CLCC, unless
a call release has been received within a specific time period.

The result fixes the problem as can be seen below:

ofonod[20847]: < \r\n+CLCC: 1,0,1,0,0,"<number1>",145\r\n
ofonod[20847]: < \r\n+CLCC: 2,0,0,0,0,"<number2>",145\r\n
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: > AT+CHLD=1\r
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: > AT+CLCC\r
ofonod[20847]: < \r\n+CLCC: 1,0,0,0,0,"<number1>",145\r\n
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: < \r\n+CIEV: 5,2\r\n
ofonod[20847]: < \r\n+CIEV: 5,0\r\n
hfpmodem: Add comment for previous commit
mbm: Delay init until EMRDY

If we send these commands before the EMRDY notification has been seen,
they will simply return an error.
netreg: Fix broken CMER behavior on MBM
bluez5: Fix copy paste error
bluez5: Add additional defines
hfp_hf_bluez5: Initial GDBusClient for BlueZ

This patch adds the initial callbacks to track when BlueZ connects so
we can register our HFP external profile handler. And tracks the
interfaces added or removed.
hfp_hf_bluez5: Add tracking of bluetooth devices

This patch tracks the GDBusProxy for Bluetooth devices in order to be
able to get their properties.
bluez5: Add HFP_AG_UUID
hfp_hf_bluez5: Register modem for HFP AG devices

Now that we are able to keep track of devices appearing and
disappearing from BlueZ, we are able to register the modem when a
device that supports the HFP AG UUID appears.
hfp_hf_bluez5: Follow HFP AG device Alias property

If the device Alias property changes we should also change the name of
the modem.
hfp_hf_bluez5: Handle NewConnection from BlueZ

Parse the essential arguments in the message, in this case only the
file descriptor, and register the modem if it is not already
registered. This is necessary because in some cases, we may receive a
NewConnection call, and the SDP process is still taking place.
hfp_hf_bluez5: Add SLC establishment procedure

When receiving a NewConnection call from BlueZ, initiates the Service
Level Connection using the received file descriptor. The HFP modem
sub-components (devinfo, voicecall, netreg, handsfree and callvolume)
are created at this point.
bluez5: Add SCO socket declarations

Adds local copy of SCO Bluetooth sockets declarations, since the
objective to avoid including BlueZ library headers.
bluez5: Add bt_bacpy()

Adds a copy of BlueZ bacpy() function.
hfp_hf_bluez5: Add SCO listen socket

This patch adds the initial SCO server socket handling. BtIO and BlueZ
functions should not be used, with the new Profile API the objetive is
to get rid of these dependencies.
bluez5: Add bt_ba2str()

Adds a copy of BlueZ ba2str() function.