HID: Fix memory leak in HID Code

This patch fixes memory leak in HID code when interrupt reports are
received from remote device before HID connection is setup.
CL from qcom(Hemant Gupta)

Change-Id: If4fe961921c7b1212035cf5f2aa60d2359e322e2
Merge "HID: Fix memory leak in HID Code" into klp-wireless-dev
HID: Reset Idle timeout to 0 while hid disconnection

This patch resets idle l2cap timeout to 0 while disconnecting HID L2CAP's.
without this patch it was observed that after hid l2cap disconnection,
ACL disconnection was taking 4 seconds.

Change-Id: I39f16d3981f4a8b5cdf28cd7865631900007d5b8
HID: Handle connection failure in disconnecting state

This patch handles connectio error of interrupt channel while in
disconnecting state. Without this patch it was seen that upper
layers would not be informed about failure of interrupt channel
connection in this corner case leading to UI stuck at connecting
forever.

Change-Id: I1f5f18e70470eff17b21f2ed921edaefd3c89f9c
HID: Serialize L2CAP disconnection

This patch serializes host initiated hid disconnection by sending
control channel disconnect request only when disconnection response
for interrupt channel has been received.

Change-Id: Ie0c5c62593bb0dd32f83b76bf0d6c1d950f1a684
HID: Use dynamic memory while sending report

This patch uses dynamic memory allocation while sending HID output data to
remote device depending on size of data to be sent. Without this patch
fixed size static buffer of 200 bytes was being used for sending data to
remote device, which was resulting in crash in case data size to be sent
to remote device was greater than 200 bytes.

CL from qcom(Hemant Gupta)
Change-Id: Icc8cd4a4ecfd4bc30cbf848a7c865fcf9308ddf8
HID: Remove device from nvram on auth failure

This patch removed hid pointing device from nvram on authentication failure
due to pairing timeout or when wrong passkey is entered. Without this patch
it was observed that hid pointing device was always shown in paired list
when DUT was restarted after authentication failure.
CL from qcom(Hemant Gupta)
Change-Id: I69c43d2ed982d5d5abfd5707db90ef4b5c65b34f
HID: Reset Disconnect Reason on Connection Establishment

This patch resets the disconnect reason to successful on HID Interrupt
channel establishment. Without this change, wrong reason is propogated
to BTA layer on disconnection initiated either from DUT or Remote end.

Change-Id: I42641b511e44a761574faf8eafb7b0826e24aeb3
GAP: Try to retrieve CoD from NVRAM if 0

This patch tries to retreive CoD from NVRAM if CoD is 0. This is
because in scenarios when airplane mode on/off, inquiry is not
performed again on devices shown in Available devices List of
UI, so CoD is 0 during SSP information as database of stack is
not properly updated since inquiry is not performed again. Without
this patch it was observed because of wrong CoD info device icon
for HID mouse was changed to Joystick and device is not shown in
Paired List. Also some extra debug logs are added in code for
better debugging.

Change-Id: I14858ccee04728cb4b9cd60d397b79fa6494b842
HID: Parse paired hid devices from bluez.

This patch adds support for parsing SDP records of paired HID devices
from bluez device storage path and store the parsed hid sdp data into
bluedroid storage path. Without this patch, it was not possible to
have paired HID devices during upgrade from BlueZ to Bluedroid Stack.

Change-Id: I7db4a801f3cf9ca46fc0eabfd929e8d7c16b5edb
HID: Use dynamic memory while sending data

This patch uses dynamic memory allocation while sending HID output data to
remote device depending on size of data to be sent. Without this patch
fixed size static buffer of 200 bytes was being used for sending data to
remote device, which was resulting in crash in case data size to be sent
to remote device was greater than 200 bytes.

Change-Id: I5ed12422355e88d7ef0391668800d7619ca3b685
audio: fix set_parameters return value.

xxx_set_parameters functions were returning the status
returned by str_parms_create_str() which is incorrect.
These functions should return 0 when no error occurs.

Change-Id: I984d95457c985fbaf1a15baa522f8a84f99dd7c9
flounder64: bluetooth: Adjust volume level on BT HS and DUT side

MW600 Bluetooth address is "58:17:0c:e8:b0:7a". It is not included in
AVRCP profile white list. So it can't support absolute volume. We need
to  whitelist it by device name "MW600" instead device address method.

Signed-off-by: Thomas.TT_Lin <Thomas.TT_Lin@htc.com>
Change-Id: I41b27fbab13dcf9d0005e8d5ae25ffb95eb546d4
SDP: Allocate proper sized scratch buffer for SDP response

The buffer allocated for attribute response is being reused
for subsequent requests for an SDP connection. Check the
buffer size before using for subsequent requests and
reallocate if required.

Change-Id: Ib00aff2c4512192c29265cf0adb89e380adf0b35
Allow simultaneous LE Observe and BTM Inquiry/Scan

This patch allows BTM inquiry and LE observe to be launched
and overlap each others' occurance by redirecting results
and handling states accordingly.

CRs-Fixed: 579505

Conflicts:
	stack/btm/btm_ble_gap.c
bug 12939764
Change-Id: Ifde73f17f8d40e9ebfff3b49e409591189574ee0
a2dp audio HAL: use correct interface version

Do not use AUDIO_DEVICE_API_VERSION_CURRENT version
but AUDIO_DEVICE_API_VERSION_2_0 to reflect the version
actually implemeted.

Change-Id: I31407af7fc4769be1d259ee739422ce9f598be2e
Increasing the SDP_MTU_SIZE from 256 to the default 672 bytes

This works better with IOT of devices
bug 10588724

Change-Id: I28fd74339d8f344b056b82bf2d71e7d70be7a0fa
Merge "Use 0000 as pin key for PORCHE_PAIRING_CONFLICT issue"
am 2e470dc4: Merge "Use 0000 as pin key for PORCHE_PAIRING_CONFLICT issue"

* commit '2e470dc48e608fd46cd2d55aa01efb9ce7eb4bdb':
  Use 0000 as pin key for PORCHE_PAIRING_CONFLICT issue
am 1b562939: am 2e470dc4: Merge "Use 0000 as pin key for PORCHE_PAIRING_CONFLICT issue"

* commit '1b562939899f7c91c437b390e6e216c7c53acfd6':
  Use 0000 as pin key for PORCHE_PAIRING_CONFLICT issue