Bluetooth: Increase HF connection timeout

A BT headset takes longer time to establish SLC
connection. So, increase HF connection timeout
from 5 seconds to 10 seconds.

Change-Id: I1af681177db01902f6121fe4cd9817476e4c78c7
Bluetooth: Move to proper SCO state.

On SCO shutdown event,while in SCO
opening state,  move to SCO shutdown
state.

CRs-Fixed: 652289
Change-Id: I72f3c602d3873afd1f976f026fb9b6f25afff952
BT: MHF: Check codec support for HS requesting SCO transfer

In case of SCO transfer from one HS to other, check peer
codec supported by HS requesting the SCO transfer instead
of HS which has SCO connected.

CRs-Fixed: 619892

Change-Id: I29a1e41904a78c7bbb00dfc119a4783d09de12ca
BT: Don't stop sniff timer before checking for service ID entry

- Avoid stopping sniff timer before checking for service
ID entry for which bta_sys_conn_close is called since if
entry is not present we return without re-starting timer
and ACL doesn't go into sniff.

CRs-Fixed: 658531
Change-Id: Ie9e4a705cb7003e8d10064af68ac6850652bd24e
Bluetooth: Dont retry sniff.

This change makes sure that DUT
does not retry to intiate sniff
if device is already in remote
initiated sniff mode.

CRs-Fixed: 624633

Change-Id: Iba2e28ae0505ac65a10a163d802c3b44a2208982
HID: Add JW MT002 and BORND Mouse(s) to blacklist

This patch adds HID Mouse(s), JW MT002 and BORND to blacklist.
This adds behaviour of host disabling SSR for JW MT002 and prevents
Host from sending Sniff subrating command to SoC for BORND mouse
so as to avoid IOT issues of disconnection and slow mouse movements
respectively with these device.

Change-Id: I4fde2cc495baad1b993fbde529052ad122b0ba25
CRs-Fixed: 646480
PM: Stop Power Manager Timer if in sniff mode

Power manager timer is started when link is in active mode depending
on profile connected. This timer was never stopped when link was put
in sniff mode by remote device preventing system from not going
to sleep mode since timer is still active.

Change-Id: I7569eed3ad7e0487e411377977b4f0671f24df12
CRs-Fixed: 679896
HFP-HS: Abort parsing in case of format error

Abort parsing in case of format error in AT commands.

Change-Id: Id3973da824b4229fcf69a256a0615ce5b1e0677b
Bluetooth: Add PORT_EV_TXFULL event if Tx queue is full

Add PORT_EV_TXFULL event when Tx queue is full and write the data
to L2CAP until queue is empty. Also this will avoid polling for more
data from socket if data is available in Tx buffer. Otherwise, polling
for data from socket whenever queue is full and this will cause high
CPU usage.

CRs-Fixed: 625250
Change-Id: Icc4104262dc76df0d779aceec880500177e4c4ea
Bluetooth: Updated ATD string parsing.

This change makes sure that the Dial string
parsing accepts 'pause' and 'wait' characters
too.

CRs-Fixed: 644386
Change-Id: I9e5f774b711917c4a577ba6f24c41a488ab19909
Bluetooth: use different constructor for fast flag

 -  use different constructor

Change-Id: Idbf0b1a4f1d30c454685555e2128436750b92550
CRs-Fixed: 632070
Bluetooth: Handle missing key event

This change handles HCI_ERR_KEY_MISSING event
coming to the stack when user doesn't enter any
key and timeout happens.

Change-Id: If530e8acce3f105e4f1e2841bf350ee5330f389e
CRs-Fixed: 633972
Bluetooth:GAP:Handled LMP Response time out event during SAP connection

Handled LMP Response timeout error case during SAP connection by removing
the remote device from the bonded device list of stack.

Change-Id: Ia7e11fe36cd118e27319d8b5f9682b57ef3de8f7
CRs-Fixed: 637567
Removes bond when user clicks on cancel pairing

When user clicks on cancel pairing in the pairing
dialog pop up, the pairing done for that remote
device in the stack layer is removed.

Change-Id: I69bcf9f3e60ebc5e39cd9cdaa5ef8e6ba6e8d046
CRs-fixed: 626270
Bluetooth: Check for NULL String.

When JNI checks are enabled it checks for
NULL, so check for empty string for ATD.

Change-Id: I8b0cdafeb34737b95041ed6a6ec117fa32effa36
CRs-Fixed: 676866
Bluetooth: HID: Reject incoming connection from unpaired device

This patch rejects incoming HID Control Channel request from unpaired
HID devices. Without this patch it was seen that incoming connection
request was accepted for unpaired devices and connection was later
disconnected by DUT when it checked at upper layers that remote device
is not paired, which resulted in hid movements on DUT because of the
delay. Also handling is done for HID Pointing device to be set as
paired by setting linkkey as known when hid connection is up and vice
versa when hid pointing device connection is unpaired.

Change-Id: I4dda40f1f551e04179310e1dfffadf2692bcc5bb
CRs-Fixed: 568386, 568967
Bluetooth: To disconnect HH profile at device unpair

This change sends a hal callback to the HIDService, to disconnect
the HH profile to make sure that the profile conn state
is correct at the time of successive connections and pairing.

Change-Id: Id8f66b22608cd5154d2e4b8e2217621294d6e339
CRs-Fixed: 573541
HID: Add proper check before accessing connecting bd address

This patch adds check before dereferencing connecting device bd address
as it might have already been cleared. Without this check it was observed
that NULL pointer dereferencing took place in memcmp in corner cases.

Change-Id: I26d99e377b6028519dcd23c9aa5370980c6c544a
CRs-Fixed: 646427
Bluetooth: Delete node properly.

Update connect node when first node is deleted
in multiple node scenario.

Change-Id: Icce618e91405e1eeb5962450fabe350ef7128475
CRs-Fixed: 670102
Bluetooth:GAP: Update Local device name immediately to NV

Local device name not updating to NV immediately and dut is not
visible to remote for first time scan after local name change.

Change-Id: Ic47b17ef366a83da9b374077742c00661a2c3014
CRs-Fixed: 649529