Bluetooth: Fix to avoid A2DP choppiness while disconnecting PAN

A case where A2DP is going on & PAN is connected. A2DP
choppiness is observed while disconnecting PAN. Because A2DP
media task is unable to write data on L2CAP. As BTU task is
blocked while disconnecting PAN for destroying tap_read_thread,
tap_read_thread should be destroyed in btif context to avoid
the A2DP choppiness.

Change-Id: I0d8c5110743eedf9bce8a41b71a364d0d076ca76
CRs-Fixed: 593440
Bluetooth: Handle Transient Audio Focus Lost

Changes made to Handler Transient Audio Focus in btif layer.

Change-Id: I7d25a4b9b13ea35784a8232617b9a8c0c55ec5b3
CRs-fixed: 590190
HID-C: 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: I574cad0a0c10a5138dbc48de4d7225ddcd321210
CRs-Fixed: 586886
HID-C: Add support for error parameter in report_error

This patch adds support for handling error parameter in report error
API so that application can be provided better flexibility for reporting
correct error codes for Set Report from HID Host. Also some API comments
are updated for HID Client.

Change-Id: Ide56b2dc16e06ff270e3257eafc62de03c7cecf0
CRs-Fixed: 595139
HID-C: Update sniff parameters for HID Client during inactivity

This patch updates HID Client power manager table to use sniff
parameters of 54 slots during inactivity of 5 seconds when ACL
link is active. Without this patch it was observed that if
sniff paramteters of 180 slots were used, lags were seen on HID
host.

Change-Id: I75efed33ebea735b631c1b36fadf4f8813f6a129
CRs-Fixed: 590731
Bluetooth: GAP: Send Peer connect resp on Delay check

Send L2CAP Peer connect response with status auth
pending so that remote device can extend the waiting
time.

CRs-Fixed: 581067
Change-Id: I6cf6a72640de938a8145b541d4bad1bcba758ac5
Bluetooth: Added new API in btif layer to get Remote Supported features

Added new API in btif layer so that application can get the
Remote supported by using this.

CRs-fixed: 594652
Change-Id: I9ec9101d550dca6982b693b46d5d5c087c78a6e6
Bluetooth:GAP: Cancel discovery in case of RNR is active

Send Search cancel event to the BTA layer in case of RNR
is active though the inquiry is completed on receiving
the cancel discovery from upper layers.

Change-Id: I168dff127e1ae01bd9342e84b86bf4cdea9bcf9b
CRs-Fixed: 594866
Bluetooth: A2DP Sink handle streaming for multiple configurations

 - update frames processing rate for different configuration

Change-Id: Ice739772a43c66f8a919f79da99e2c79a3bfe2ee
CRs-Fixed: 591254
Bluetooth: Move to proper state.

Move to init state after cleanup on
connection failure of streaming channel
and failure of response from remote for
get capabilities.

CRs-Fixed: 597781

Change-Id: I011d9ffe9d721235217320c1e5281f70328c7f13
Properly handle outgoing connection request in opened state

Properly handle outgoing connection request in opened state.
This happens in race condition when we try to connect to a remote A2dp
device from Bluetooth Settings UI and simultaneously there is incoming
connection request from previously connected remote. This fix addresses
the scenario where because of incoming a2dp connection from second device
btif moves to opened state and then the outgoing connect request is
received in btif for first device. This scenario is handled by gracefully
rejecting the outgoing connect request from btif layer for first device
if it is already connected by the incoming connect request for second one.

CRs-Fixed: 595148
Change-Id: I308bad99bd26adb528f7b97e6cc5bbdfaf939cbb
Merge "Bluetooth: GAP: Send Peer connect resp on Delay check"
Merge "HID-C: Update sniff parameters for HID Client during inactivity"
Bluetooth: Fix deadlock in A2DP Sink streaming and HF connection

 - Use strong pointer to fix deadlock during A2DP Sink streaming
   and incoming HF connection

Change-Id: Ia60bf18356409edbd9eaeeaa03cdb35e192c9d51
CRs-Fixed: 584275
Bluetooth:GAP: Add NULL check before accessing BD address

Add NULL check before accessing p_bd_addr variable to
avoid null pointer exception while referring to invalid
memory.

Change-Id: I3897248cf9be39898f9dc711afd22551607c9419
CRs-Fixed: 596149
Merge "Bluetooth: Added new API in btif layer to get Remote Supported features"
Merge "HID-C: Reset Idle timeout to 0 while hid disconnection"
Merge "HID-C: Add support for error parameter in report_error"
Merge "Bluetooth: Handle Transient Audio Focus Lost"
Merge "Bluetooth: Fix to avoid A2DP choppiness while disconnecting PAN"