tools/btmgmt: Add set-io-cap command

This is needed for testing e.g. PTS
tools/smp-tester: Add client test case for MITM
android/hal-audio: Fix PT in media packets

According to A2DP 1.3 spec section 4.3.3.2:
"A payload type in the RTP dynamic range shall be chosen (see [22],
section 3)." - [22] = RFC3551

As per referenced RFC3551, values in range 96-127 are reserved for
dynamic assignment so we can set PT to 96.
android/hal-audio: Fix media_packet definition

rtp_payload field in media_packet is specific for SBC codec thus it
should be moved to SBC codec implementation and removed from generic
structs.
android/hal-audio: Make RTP header optional

Not every codec on A2DP will use RTP so it's now optional - codec can
be defined to use it and core will take care of filling the data.
android/hal-audio: Make update_qos optional
android/hal-audio: Send packets only when data were encoded

Codec may not return encoded packet on every encode_mediapacket call,
i.e. in case there's not enough data it may buffer data and encode on
subsequent calls when enough data were provided. We need to make sure
media packet is written only in case somethind was encoded so we don't
send empty packets.
android/hal-audio: Allow to autoselect endpoint in open_stream IPC

audio_open_output_stream always tries to open 1st registered endpoint
based on assumption that there is only one endpoint registered anyway
(due to support for only one codec). With more endpoints available in
future we need to be able to retrieve endpoint id which is connected
and use it for streaming.

This patch adds special case for id=0 in open_stream IPC to return 1st
opened endpoint on BlueZ side which is enough for now since only one
headset can be connected at any time (i.e. we should not have more
than 1 endpoint opened).
shared/gatt: Return bool in gatt_db_get_attribute_permissions

It will return true if attribute with given handle exists in db and
set permissions value, otherwise it will return false.
Now, if get_permissions failed, we should reply with
ATT_ECODE_ATTR_NOT_FOUND.
android/gatt: Check for invalid handle errors

Check if handle or handle range is valid for server. If is invalid,
reply with ATT_ECODE_INVALID_HANDLE.
tools/btmgmt: Add support for passkey requests
tools/btmgmt: Add support for passkey notification
monitor: Fix User Passkey Request name
emulator: Fix matching up connections to random addresses
emulator: Fix random address type in LE conn complete events
android: Fix compile error

During configure, if SBC is not installed in the system, we may use
SBC_CFLAGS and SBC_LIBS variables to indicate where SBC headers and
binaries can be found.

However, SBC_CFLAGS variable is not used in android/Makefile.am,
causing the following compile error:

$ ./bootstrap-configure SBC_CFLAGS=-I../sbc SBC_LIBS=-L../sbc/src/
$ make

(...)

android/hal-audio-sbc.c:22:21: fatal error: sbc/sbc.h: No such file or directory
 #include <sbc/sbc.h>
^
compilation terminated.
make[1]: *** [android/android_audio_a2dp_default_la-hal-audio-sbc.lo] Error 1

This patch fixes this error by appending SBC_CFLAGS to android_audio_
a2dp_default_la_CFLAGS.