doc: Add EchoCancelingNoiseReduction to Handsfree

This patch adds echo canceling and noise reduction property to Handsfree
interface, allowing the handsfree unit to disable this feature in the
audio gateway. The HFP spec defines the procedure to turn off echo
canceling and noise reduction only, it is not allowed to enable this
feature from the HF unit.

According to Bluetooth HFP 1.6 spec: By default, if the AG supports its
own embedded echo canceling and/or noise reduction functions, it shall
have them activated until the AT+NREC command is received from the HF
unit. From then on, and until the current Service Level Connection is
dropped for any reason, the AG shall disable these functions every time
an Audio Connection is established.
core: Add "echo-canceling-and-noise-reduction"

This patch adds "echo-canceling-and-noise-reduction" to "Features"
property of the Handsfree interface.
core: Add EchoCancelingNoiseReduction to GetProperties

This patch adds EchoCancelingNoiseReduction property to GetProperties
method of Handsfree interface.
core: Set EchoCancelingNoiseReduction to TRUE by default

According to Bluetooth HFP spec: By default, if the AG supports its
own embedded echo canceling and/or noise reduction functions, it shall
have them activated until the AT+NREC command is received. The
configuration set by the HF shall by used by the AG while the Service
Level Connection is active.

Since there isn't a command to query the current value, it is being
assumed that Echo Canceling and Noise Reduction is enabled when the
connection is established and the gateway supports this feature.
include: Add disable_nrec to handsfree driver

This patch extends the handsfree driver adding echo canceling and noise
reduction callback to allow disabling this feature in the audio gateway.
hfpmodem: Add EchoCancelingNoiseReduction

This patch adds echo canceling and noise reduction implementation to
hfpmodem. It adds the implementation to send the command "AT+NREC=0"
to the AG.
core: Add SetProperty for EchoCancelingNoiseReduction

This patch extends SetProperty method of the Handsfree interface
allowing to disable echo canceling and noise reduction feature in
the audio gateway through a D-Bus method call. Once disabled, it
is not allowed to enable it using this procedure.
bluez5: Unify bt_register_profile_* into a single function

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.
hfp: Add defines for HFP SDP feature bits
hfp_hf_bluez5: Register the SDP record with correct features
hfp_hf_bluez5: Fix re-registering a modem for a device

Even for outgoing pairing requests we may receive the UUIDs property
changed after the device is paired and try to register it twice.

The easiest way to reproduce this is when Extended Inquiry Response is
supported.

When the device is paired, we receive the "Paired" PropertyChanged,
inside modem_register_from_proxy(), g_dbus_proxy_get_property() gets
the UUIDs extracted from the EIR data.  Later, when the service
discovery is finished, the UUIDs property is re-sent and both may
contain the HFP AG UUID.

Valgrind log:

ofonod[8157]: src/modem.c:ofono_modem_create() name: hfp/org/bluez/hci0/dev_40_98_4E_32_D7_39, type: hfp
ofonod[8157]: src/modem.c:set_modem_property() modem 0x66a2db0 property Remote
ofonod[8157]: src/modem.c:set_modem_property() modem 0x66a2db0 property DevicePath
ofonod[8157]: src/modem.c:ofono_modem_register() 0x66a2db0
ofonod[8157]: plugins/hfp_hf_bluez5.c:hfp_probe() modem: 0x66a2db0
ofonod[8157]: Modem register failed on path /hfp/org/bluez/hci0/dev_40_98_4E_32_D7_39
ofonod[8157]: plugins/hfp_hf_bluez5.c:hfp_remove() modem: 0x66a2db0
ofonod[8157]: plugins/hfp_hf_bluez5.c:profile_new_connection() Profile handler NewConnection
ofonod[8157]: src/modem.c:get_modem_property() modem 0x66a2db0 property DevicePath
==8157== Invalid write of size 4
==8157==    at 0x4712A5: hfp_slc_info_init (slc.c:59)
==8157==    by 0x486B00: profile_new_connection (hfp_hf_bluez5.c:168)
==8157==    by 0x412C70: process_message.isra.4 (object.c:258)
==8157==    by 0x5381984: _dbus_object_tree_dispatch_and_unlock (in /usr/lib64/libdbus-1.so.3.7.2)
==8157==    by 0x5373C4F: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.2)
==8157==    by 0x4107B7: message_dispatch (mainloop.c:76)
==8157==    by 0x5089BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==8157==    by 0x5089044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==8157==    by 0x5089377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==8157==    by 0x5089771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==8157==    by 0x41042B: main (main.c:249)
==8157==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==8157==
handsfree-audio: Fix replying to an empty D-Bus message

In the case that ofono_handsfree_card_connect_sco() is called outside the
context of a .Connect() call, there's no message we need to reply.  This
happens, for example, when the HFP AG plugin initiates a SCO connection when
it receives an AT+BCC command from the HF.
bluetooth: Add define for SCO voice settings

Add defines for SCO voice setting (Air Coding). Air mode "Transparent
Data" shall be supported if wide band speech is supported.
handsfree-audio: Add setting SCO air mode
hfp_hf_bluez5: Handle org.bluez.Profile1.Cancel()

Cancel() will be called when the ConnectProfile() is called, perhaps
even replied with a success, and the user cancels the connection
attempt.
hfp_hf_bluez5: Handle org.bluez.Profile1.Release()

There's nothing we can do in this case, so we only reply with a
success.
test: Create simple-handsfree-audio-agent

This python tool implements the org.ofono.HandsfreeAudioAgent interface,
dealing with the SCO file descriptor passed by the Handsfree Audio
Manager.
include: Add ofono_emulator_create_card()
emulator: Implement ofono_emulator_create_card()
hfp_ag_bluez5: Create card when connect