avrcp: Fix response ctype of AbortContinuingResponse

Request ctype of "AbortContinuingResponse" is CONTROL, so response
should be ACCEPTED instead of STABLE. This affect PTS Test Case for
TP/RCR/BV-04-C.
avrcp: Add error code for rejected vendor command

Fix response for any vendor commands when there are no players
registered. According to the specification responses should be
REJECTED with error code.

"For error response PDU the response parameter is always the
error code independent of the response format defined for
ACCEPTED PDU response for the corresponding PDU command."
(source: section 4.7.9 of AVRCP 1.3 specification)
audio: fix missing unref in case of error

audio_adapter_get() increases the reference counter of the adapter, so
it's necessary to decrement it in case of error.
audio: fix missing io channel shutdown

Channel must be explicitly shut down because otherwise the reference
counter never reaches zero, due to the server installed by bt_io_listen.
audio: fix io channel shutdown on error

In the unlikely case of service record allocation error, the io channel
should be properly shut down.
sdp: Check type of sdp data before dereferencing
device: don't auto-connect on disc-cb attio callback registration

If a device is already connected, don't auto-connect if we register
a disconnect-only attio callback. This will obviously fail.
Revert "core: Add provision for terminating an ATT connection"

This reverts commit f89a77478af78d41c80ab7605662382b9e4e1c36.

This is not needed and actually introduces a bug. When the "Disconnect"
API of device is called device->attrib is unref-ed via a watch set on
G_IO_HUP. The channel is shutdown when the last reference is removed.

The code introduced here shuts down the channel and prevents the watch
from getting called. This means we leak a reference to device->attrib.
This can cause a number of bad things. For example, if the device is
temporary, it will never be freed, and we won't be able to pair to it
again.
HFP gateway: fix failure on very first GSM connection

This patch fix the very first incoming connection from a GSM device
(playing the gateway role), when 'device->gateway' is NULL (when we
didn't perform a SDP browse request yet)

we add the service with 'btd_device_add_uuid(device->btd_dev,
remote_uuid)' but we provide HFP_HS_UUID as remote_uuid. Consequently,
the HFP headset service is activated instead the gateway service.
attrib-server: Fix sending "not supported" for indications/notifications

Now that our Attribute Client is able to handle notifications and
indications we don't need to respond that they are not supported.
input: Remove unneeded Bluetooth Address arguments
input: Remove unneeded alias
wiimote: Detect Wii Remotes by device name

We currently detect Wii Remotes by DID information. However, not all Wii
Remotes (especially 3rd party Wii Remotes) provide DID information.
Moreover, they provide no way of identifying them aside from their
device name. Hence, this adds an experimental name-detection for Wii
Remotes.
Remove leftover code of main_opts operation
attrib: Centralize ATTIO connection management

On Generic Attribute, register only one ATTIO connection callback to
centralize the connection management.

Also make sure the connection reference is properly dropped only if
there is no pending operation.
attrib: Discover Characteristics if already connected

On Generic Attribute, Discover All Characteristics of a Service can be
started immediately if already connected, without registering a ATTIO
connection callback.
attrib: Move Characteristic Discovery reply to a new function

Minor cleanup patch moving the creation of the reply for Discover
All Characteristics call to a new local function in the Generic
Attribute.
attrib: Register only new characteristics found

This avoids duplicating registration for previously found
characteristics.
attrib: Protect GAttrib when there is a pending write
attrib: Fix missing Discovery reply when disconnected

This patch fixes missing reply for DiscoverCharacteristics method on
Generic Attribute. If link is disconnected reply message is not sent.