MAP: Support MAP Client role on Bluedroid stack.

Support Implementation changes from BTA and BTIF layer
for MCE role on Bluedroid stack.

CRs-fixed: 530274

Change-Id: I8547b0f28338e83edabae969121872ca23fdcb36
(cherry picked from commit 88ff37b708c4394e17dc01d582cad92df82f7cee)
(cherry picked from commit 040b14805355a40522b848634e42de4f960eb368)
(cherry picked from commit 898b77d246e9c35a0d39a0c9c6e19ea75f056ee9)

Conflicts:
	btif/src/btif_core.c
Bluetooth: Support  HFP Client role on Bluedroid.

Implementation changes in BTA and BTIF layer to support
HFP Client role on Bluedroid stack.

Change-Id: Ia1af01c19326cac326da9b4eb1f845f0d82b3c0c
(cherry picked from commit 2aa98cf1d2e07856544fe60b4fe32d5cb6c58b9c)
(cherry picked from commit bf1aa445933498574906d25439d54cb6b40f9c91)
(cherry picked from commit f08ac0199dea0286f8a1227744b4b2efc084d045)
Bluetooth: SAP: Add 16 digit authentication support for SAP

This change consists of:
16 digit authentication support for SAP

Change-Id: I6488b449a59f90b879fff3c0fe0ca4ecefdc1947
(cherry picked from commit 7b2c37a7c3d0d95558385cc73b039f207834dd93)
(cherry picked from commit 0c28e3643378250a53458b62b33a03b047851b5c)
(cherry picked from commit 753cf921dfc66b6e6700ff59b8754c0a4c01685a)
Bluetooth: Added HFP features bitmask function.

This function gets excuted when application
sets the value of HFP features support and
ignore the stack's default bitmask.

CRs-Fixed: 482189
Change-Id: I2e355c4e3aed35ca4d1f65001d4641f94e1f2b46
(cherry picked from commit 8b5fca8e0a01a695e1cb9150dd84fa24f8218e00)
(cherry picked from commit 2739781e3c4d0808f64677cbdd7a27851d9cce14)
(cherry picked from commit 698deaa4fc25a7a03f1954ec5f2995cc1091051e)
Bluetooth: Enabled the WBS in BT stack.

This change enables compile time flag
BTM_WBS_INCLUDED in the stack.Enabling
this flag enables the WBS codec negotiation
code in the stack. Along with this
it allows BTIF layer to notify
the BT app about the codec negotiated and
changed.
All changes in stack is gaurded
using BLUETOOTH_QCOM_SW feature flag.

Change-Id: I1c08e33b39a51a23822530ebfc925a9b9e96712f
(cherry picked from commit c98e680303d10866d41319f46e14081838d8fc29)
(cherry picked from commit 0ea6d93c0d5d0e572af8e2c06f4ad7bd733c9d00)
(cherry picked from commit 7e091b0066a7e4d00f0bfa05dd788818f696731e)
Bluetooth: Update held call state.

In a three way call scenario,when an active
call is dropped by remote, the single held call
state is not update to the connected headset.
This change will make sure that it is updated
properly.

CRs-Fixed: 538599
Change-Id: I936c6563dfb429ff977ac993ac994d59fc58528b
(cherry picked from commit b31955e99c4258501f53301aac1e635169f9d1a5)
(cherry picked from commit 0bc840ebc516e5fd74f5d5dde58241d6fd5f9148)
(cherry picked from commit 86194d195eb7ae8700c00f0d3cbc941a11a3d4b6)
Bluetooth: Auto connect is serialized with stack Init.

Some times Auto connect is getting triggered before stack
Initialization.

Added the connect request to the connect queue and triggering
connect queue to excecute after the Initialization

Change-Id: I4236a0b37d7a9cbfff4c058b589ce201d539c5a2
CRs-fixed: 495376
(cherry picked from commit ec3d599e9b7284b07e0d48738e2ec0edb46d0288)
(cherry picked from commit 80f654cbd17db285087a5c79bbe04aedf4f7bfc5)
(cherry picked from commit 84d2b344fabae53cf89b3def87986dbb448205a0)
Bluetooth: Added BTA_AG_FEAT_UNAT bitmask.

This bitmask is used by BT stack along with
BRSF feature set to enable handling non
HFP AT commands and propagating them to
application to process.

CRs-Fixed: 522602

Change-Id: I7bd72cf9aef7a5825cecc865299260af1221da45
(cherry picked from commit 10f057e43af5379207fbdccace92dd406d98b7b7)
(cherry picked from commit 597866ade004d416ab0bc4368da58ae147e4d8c4)
(cherry picked from commit 9b5e2b79a30f3b4b607f04c0284a76035a13a7d5)
Suspend a2dp if remote initiates start during active call

Suspend streaming if remote initiates avdtp start during an
ongoing call. This helps remote and DUT's a2dp state to be in
sync.
CRs-Fixed: 516822
Conflicts:
	btif/src/btif_av.c
Change-Id: I526355f9bd97b7695102626fa982c39b74bfd82c
(cherry picked from commit c9c7239f87fc90ca8cf6d35885f189370f575e20)
(cherry picked from commit 090dee5a433eff13dee2eceb89f0701127717a44)
Bluetooth: Changes to support AVRCP 1.5 feature

Changes in stack for AVRCP 1.5.
- SDP and capability changes.
- Changes done to Register Callback functions with L2CAP
  layer for Browsing channel on a particular PSM.
  L2CAP through callback sends indication to AVCT layer
  of connection, disconnection, data and congestion
  indication.
- Changes made in AVCT and AVRC layer to support AVRCP
  browsing response
- Changes made in BTA layer to handle browsing command
- BTIF changes for Browsing and address player command.
  Added  Address player and available player change
  notification.
- During DUT initiated disconnect,changes made to
  disconnect L2CAP Browsing channel.
- Seprate Queue added in browsing channel to handle
  L2CAP congestion.

Change-Id: I54a052349f672141f24f6e4d5db0f6f929a9c66d
(cherry picked from commit 86086a18f03a0bd7752ee1db6aa0fd8200087bc2)
(cherry picked from commit 68dc0d817e1d2bab37b64fdf398539bf78ddf5d5)
(cherry picked from commit ec20b2c8b2ac90a8edf39ad3e82012f61aadfc35)
Bluetooth: Allow Carkit to play just after call

Removing check in stack where AVRCP Play and Pause commands
are being dropped if carkit initiates play or pause within
six seconds.

Change-Id: Ibb04223de746f528b356e78bd65130d3fd526a44
CRs-Fixed: 517806
(cherry picked from commit d0c1d55dc089eee82733129996ce433cf81f0110)
(cherry picked from commit 09e5703c3b140f095611f5169418b1e77256850a)
(cherry picked from commit 4c20c56d3808670eccdf21de2b250f531d5221da)
Bluetooth: HID: Add support for Set Idle and Get Idle commands

This patch adds support for sending set idle and get idle commands to
remote HID device, on receiving the function call from upper layers.
Also on reception of get idle time from remote device, upper layers
are infrmed using registered callback.

Change-Id: I14bc2dc349354fd87ef8aba25357514398532e87
CRs-Fixed: 522511
(cherry picked from commit df5f7aee169ea9a40b16326d24e54dd56ddbf273)
(cherry picked from commit 67f8323d4249b7d872f0eebcbd4741c08ab45141)
(cherry picked from commit 3bf9c3818076d3f1c40197e0a57f331fae6e5159)
Bluetooth: HID: Use dynamic memory instead 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
CRs-Fixed: 566444
Bluetooth: Add Get/Set socket option to the Rfcomm socket.

Introduced Get/Set socket option support to the Rfcomm socket.
Currently Rfcomm socket supports get/set modem bits socket
options.For other sockets it will return error.

CRs-Fixed: 557180
Change-Id: Ia1779293b643c22d3f754c7f405646d42eb94963
(cherry picked from commit 3e7a06fb96709594d190db0686dfef96237bd6c4)
(cherry picked from commit a151f0fb3b56ac424f89b52f1a00616931b5c401)
Bluetooth: Add support for disconnecting HID based on priority

This patch adds support for disconnecting the incoming HID connected based
on priority of remote HID Device. If user does not want to connect HID
profile for a particular remote device, priority of remote device would be
set to 0. Based on priority of remote device, incoming connection would be
disconnected if priority is 0.

Change-Id: I97002a46a16d386a6c178445ac825788d6bf40c9
CRs-Fixed: 532234
(cherry picked from commit 3cacb2a9b77f32ad8db6af6ae90b8a94707769c4)
(cherry picked from commit b83ce18a9b7bcc9bb70ffc08f8fb44a31390b48e)
(cherry picked from commit f692bf0af2a1383c0dab09fb865f564cfda7afcd)

Conflicts:
	btif/include/btif_storage.h
	btif/src/btif_hh.c
	btif/src/btif_storage.c
MAP: Register MAP SDP record.

SDP Record register in Bluedroid Stack.

Change-Id: Ie6bd5fb750f08ddae05c5c168617c1abb5bad03c
CRs-fixed: 504042

Conflicts:
	btif/src/btif_sock_rfc.c
FTP: Register FTP SDP record.

FTP SDP Record register in Bluedroid Stack.

Change-Id: I6d1f671eac6a97d2d7173afc0ba40318c7d642fc
CRs-fixed: 504049
Bluetooth: Allow Carkit to play just after call

Removing check in stack where AVRCP Play and Pause commands
are being dropped if carkit initiates play or pause within
six seconds.

Change-Id: Ibb04223de746f528b356e78bd65130d3fd526a44
CRs-Fixed: 517806
(cherry picked from commit d0c1d55dc089eee82733129996ce433cf81f0110)
(cherry picked from commit 09e5703c3b140f095611f5169418b1e77256850a)
(cherry picked from commit 4c20c56d3808670eccdf21de2b250f531d5221da)
Bluetooth: Changes to support AVRCP 1.5 feature

Changes in stack for AVRCP 1.5.
- SDP and capability changes.
- Changes done to Register Callback functions with L2CAP
  layer for Browsing channel on a particular PSM.
  L2CAP through callback sends indication to AVCT layer
  of connection, disconnection, data and congestion
  indication.
- Changes made in AVCT and AVRC layer to support AVRCP
  browsing response
- Changes made in BTA layer to handle browsing command
- BTIF changes for Browsing and address player command.
  Added  Address player and available player change
  notification.
- During DUT initiated disconnect,changes made to
  disconnect L2CAP Browsing channel.
- Seprate Queue added in browsing channel to handle
  L2CAP congestion.

Change-Id: I54a052349f672141f24f6e4d5db0f6f929a9c66d
(cherry picked from commit 86086a18f03a0bd7752ee1db6aa0fd8200087bc2)
(cherry picked from commit 68dc0d817e1d2bab37b64fdf398539bf78ddf5d5)
(cherry picked from commit ec20b2c8b2ac90a8edf39ad3e82012f61aadfc35)
AVRCP: Proper handling of Fragmented AVCTP packet

- AVCTP : Allocate bigger buffer for reassembly
- AVRCP : Handle getelimentattr to eliminate duplicates
          and invalid attributes, this also fixes BOF.

CRs-Fixed: 576831
Change-Id: I778c3df1386339ff8a00a755ffc9f24881b5167d