Bluetooth: 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
CRs-Fixed: 516328
Bluetooth: Null check added before accessing the service record

Null check is being added before accesing the device record's
p_cur_service variables.

Change-Id: Iafeae9bbb7361586992435ca7142d0211e892d29
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
Bluetooth: Clear remote suspend flag on susupend.

Remote device may initiate AVDTP Suspend within 3s of AVRCP pause,
in that case flag is set which prevents further a2dp data.
If DUT initiates play, flag set will prevent AVDTP to go to
Start state.Change is made so that on standby flag is cleared.

CRs-Fixed: 516611

Change-Id: I6c474cd7fd9cd667744d44076ad9b681c75e3b5a
Merge "Bluetooth: Reset Disconnect Reason on Connection Establishment"
Merge "Bluetooth: Null check added before accessing the service record"
Merge "Bluetooth: Clear remote suspend flag on susupend."
Merge "Bluetooth: Allow Carkit to play just after call"
Fixes random host disconnection after establishing connection

Host starts encryption twice when the remote device is
already paired. The host sends disconnect when the
second encryption attempt returns failure. This fix
avoids duplicate encryption attempt.

Change-Id: I8ec5c4a953180ec17585aece757810421bc44aae
Fixes pairing and unpairing issues with BLE devices

After BT off/on, already paired BLE device is showing
up as unpaired. Already unpaired BLE device is
shown as paired after BT off/on. This change fixes this
issue.

Change-Id: I2b1d8c3cbb8c69350d9853195eec9c9ceee702fd
Bluetooth: Disconnect A2dp before sending SIGKILL.

Update application for a2dp disconnection,before
sending SIGKILL due to H/W error.

Change-Id: I9bb6bcbb319f7f227e61866c9aefe6f2dcd98c6c
CRs-Fixed: 490733
Bluetooth: Do not go for inquiry in BONDING State

This patch fix a special case where DUT is paired & connected
with only one device, which has capbility to intiate paring as
soon as DUT unpair same remote device. As DUT is paired with
only one device, In this case Once DUT unpair remote device. DUT
goes for inquiry & at same time remote device initiates pairing
if Bludroid stack recieve pairing request before the inquiry
start then DUT should not go for inquiry, As DUT is already in
BONDING state.

CRs-Fixed: 481263

Change-Id: I0e1ec0fdb963921629e5c52f495ae2013e679a03
Merge "Bluetooth: Disconnect A2dp before sending SIGKILL."
Bluetooth: Avoid to advertise PANU service records.

This is special case where remote device(PC) acts as PANU
& is trying to connect PANU on DUT instead of NAP. Because
DUT had advertised PANU service records on SDP. As DUT does
not support PANU-PANU connection, So connection is dropped
every time. As per spec, It's not mandatory to advertise PANU
service records, So PANU service record should not be advertised
on SDP to solve this issue.

Change-Id: I1f733467335b5e0ca00899cf4380860d233aab33
CRs-Fixed: 520804
Merge "Bluetooth: Avoid to advertise PANU service records."
Bluetooth : HID: Cancel RNR while incoming connection in progress

Cancels the RNR while incoming connection is in progress.

CRs-fixed: 507009
Change-Id: I19e361f0e838b99e3a8fc803c2ec445342970503
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
Change-Id: I78fb0e5475a866ac296ccc569e30d32cdf7590b7
Merge "Suspend a2dp if remote initiates start during active call"
Merge "Bluetooth : HID: Cancel RNR while incoming connection in progress"
Bluetooth: Add trust Device feature in bluedroid

Add set trust feature where the remote device is marked
as a trusted device. We store the trusted property of
remote device in NVRAM and use it for subsequent connection.

Change-Id: I78228f4c47b52e111a2b4d1d4bfa794b1999707e
CRs-fixed: 523135