android/bluetooth: Fix unbonding device on auth failure

This was causing removal of device info from storage and resulting in
loosing bond after bluetoothd restart.
audio/AVRCP: Fix sending invalid response to GetCapabilities

The attribute count has to be initialized with 0 since we reuse the same
buffer for both command and responses it may be already be set causing
invalid response to be generated.
android/avctp: Use predefined HEADER_LENGTH instead of sizeof

Make code consistent with using HEADER_LENGTH defined. Remove also type
conversion.
android/avctp: Fix wrong error message
avctp: Use already calculated avc header

This removes long (81 characters) line as a side effect.
avctp: trivial: Do not break short line
avctp: Use predefined HEADER_LENGTH instead of sizeof

Make code consistent with using HEADER_LENGTH already defined and used
instead of sizeof(). Remove also ugly type conversion.
avctp: Fix wrong error message
android/avctp: Move AVC_HEADER_LENGTH from avctp header

There is currently inconsistence in the avctp code with
AVC_HEADER_LENGTH defined in avctp.h but AVCTP_HEADER_LENGTH defined in
avctp.c. Move definition to place it is actually used in consistent way.
android/a2dp: Fix crash on remote disconnection

Remove setups when a2dp device is removed. This fix following:

Invalid read of size 4
   at 0x115E32: bt_stream_close (a2dp.c:1352)
   by 0x111DFB: ipc_handle_msg (ipc.c:95)
   by 0x11234B: audio_watch_cb (audio-ipc.c:67)
   by 0x48BD9C7: ??? (in /system/lib/libglib.so)
 Address 0x4a590f4 is 12 bytes inside a block of size 20 free'd
   at 0x4897E6C: free (in
       /system/lib/valgrind/vgpreload_memcheck-arm-linux.so)
   by 0x48C5E2B: g_free (in /system/lib/libglib.so)

Invalid read of size 4
   at 0x113638: avdtp_close (avdtp.c:3201)
   by 0x115E39: bt_stream_close (a2dp.c:1352)
   by 0x111DFB: ipc_handle_msg (ipc.c:95)
   by 0x11234B: audio_watch_cb (audio-ipc.c:67)
   by 0x48BD9C7: ??? (in /system/lib/libglib.so)
 Address 0x4a594a4 is 28 bytes inside a block of size 1,100 free'd
   at 0x4897E6C: free (in
       /system/lib/valgrind/vgpreload_memcheck-arm-linux.so)
   by 0x48C5E2B: g_free (in /system/lib/libglib.so)
unit/avctp: Add AVCTP unit test skeleton and first test

Adds test TP/NFR/BV-01-C. To verify that the IUT (CT) formats correctly
the following fields of the AVCTP command message: “transaction label”,
"message type(C)", PID, “packet type”, IPID and “message information”.
unit/avctp: Add TP/NFR/BV-02-C test

To verify that the IUT (TG) formats correctly the following fields of
the AVCTP response message: “transaction label”, "message type(R)", PID,
“packet type”, IPID and “message information”. Check that AVCTP send
response packet along with other information. Payload is out of scope of
this test (AVC_CTYPE_REJECTED is OK).
unit/avctp: Add TP/NFR/BI-01-C test

To verify that the IUT (TG) reports to the test system (CT) the
reception of a control message intended for an invalid PID (PID not
registered for reception of messages).
audio/AVRCP: Fix not freeing pending_pdu if session is detroyed

This fixes possibly leaking pending_pdu if the session is destroyed.
monitor: Add SMP key distribution decoding
[travis-ci] Add configuration file
android: Fix GNU old-style struct field designator

This gives a warning on clang, that turns into an error due to -Werror.
attrib-server: Remove unnecessary fields from struct gatt_channel

These fields are only used internally by attrib_channel_attach(). The
"No GATT server found..." error message was also removed as it is also
displayed by find_gatt_server().
core: Fix associating a GAttrib to a device on incoming connections

If BlueZ is running as slave, incoming connections using ATT CID will
have a GAttrib created for them. But this GAttrib will not be assigned
to the underlying device (whose struct btd_device instance was created
in response to the Device Connected mgmt event).

This patch fixes this by assigning the GAttrib to the btd_device as soon
as a connection is first requested, which is done using attio callbacks.

Note that a new GAttrib reference is taken because attio callbacks "own"
device->attrib and thus need their own reference.
alert: Only remove attio callback after ATT request was sent

If there is a single registered attio callback, any pending ATT requests
will be dropped as soon as it is removed. This commit makes sure that
the request is sent before removing the callback.

Other places using attio callbacks may need fixing as well.