Bluetooth: GAP: Add NULL check before accessing the Node

NULL check added before accessing the Bluedroid interface
layer configuration node variables.

Change-Id: Iedf1e3550037d2ce5c422ace25c07c05da7329a7
Bluetooth: Clear remote suspend flag on play state change.

Remote device may initiate AVDTP Suspend within 3s of AVRCP pause,
in that case flag is set which prevents further a2dp data.
In case DUT initiates play before standby, remote suspend flag
won't be cleared and start fails.
Change made to ensure on Avrcp play state change event, flag
is cleared.

Change-Id: I1a0f96086030cf06bbebe3de0f2bead7846c19e3
Bluetooth:DUT to initiate Sniff after A2DP Pause.

Host does not initiate Sniff after A2DP pause.
Change is done in HF Power Manager table such
that Sniff timer starts once HF is in idle and
A2DP is paused.

Change-Id: I25608db3e2b8cfe8f44b10894d5d3a7388b54ed5
CRs-Fixed: 545681
Bluetooth:check vendor data pointer while parsing AVRCP command

Changes made in avrcp_pars_vendor_cmd to have NULL check for
vendor data.

CRs-Fixed: 574911

Change-Id: I6faf9ab30fa836087bb1b3c79151f7d0f347015d
Bluetooth: modifies write Client Conf characteristics api

This changes api to use write_request to enable notifications
for hid reports. it ensures notifications enables by
receiving successful  write response for request.

CRs-Fixed: 576382

Change-Id: I4c18f2cb727a7aabddaa5c965b29eca78843fc7a
Bluetooth: Avoid overlapping Disconn commands from Host

In case the host doesnt reply to the pairing request,
and waits for the timeout, the timout causes a "disconnection"
and is folllowed by another one by SMP state machine,
at the pairing complete event. This changed adds a check,
to ignore the disconnect command, in case another one is in progress
to the same link

Change-Id: Ib71740bed80375fb44487e89600f05519cd58b10
CRs-Fixed: 546854
Bluetooth: Handle getCapability failure for Incoming Connection

This change takes care of handling GetCapability failure event for
Incoming Connection. DUT will initiate disconnect if GetCapability
response is failed.

Change-Id: Icc121739cc3da6f999a09f2e576cbfaec3007155
CRs-fixed: 506864
Bluetooth: Allow connection update after conn update request is enabled

This change maintains the PENDING state for connection update
requests sent by the remote. This allows the central to update
the connection parameters requested by the peripheral after the
conn update requests are enabled (after SMP pairing and service
discovery completes).

Change-Id: Ib17730ee011e2457de5d8b1a2c2eba9a88f71bc7
CRs-Fixed: 562319
Bluetooth: Check A2dp state inside mutex lock.

In race conditions A2dp state was updated to suspended
after checking and before acquiring mutex lock.A2dp State
should be checked inside mutex lock to avoid checking against
inconsistent state.Prevent overwriting of state
from AUDIO_A2DP_STATE_SUSPENDED to AUDIO_A2DP_STATE_STOPPED
which would again start the data path.With this change we make
sure to check state inside mutex lock and also avoid overwrite
of state in case of write failure.

Change-Id: I1d74490057fea06113dcf4e0666387f4d5224157
CRs-Fixed: 572205
Merge "Bluetooth:DUT to initiate Sniff after A2DP Pause."
Merge "Bluetooth:check vendor data pointer while parsing AVRCP command"
Merge "Bluetooth: Clear remote suspend flag on play state change."
Bluetooth: Introduce open/close interfaces for ANT

Introduce Open/Close interfaces for ANT so that ANT module
can retrieve the ANT channel for send/receive of ANT data

Also Enables Bluetooth clean turn on flag so that there will be
no unnececessary turn off happens before Bluetooth turn-on
is dispatched

Change-Id: I8583ca529d7aae0b6a18813e200a8a2643b31fb1
Bluetooth: HID: Properly check if SDP is required on HID device

This patch clean up HID Outgoing connection for pointing devices
by preventing multiple SDP to HID Pointing device by checking if
outgoing connection is already in progress or device already
connected. Without this patch, connection state was getting stuck
with pointing device that required authentication when another
HID conenction was disconnected in between.

Change-Id: I552fece5de8d361695f0ca3fb7e58d500e3a1e33
CRs-Fixed: 576827
Merge "Bluetooth: GAP: Add NULL check before accessing the Node"
Merge "Bluetooth: modifies write Client Conf characteristics api"
Merge "Bluetooth: Check A2dp state inside mutex lock."
Merge "Bluetooth: HID: Properly check if SDP is required on HID device"
Bluetooth: GAP: Update bonded device info immediately on NVRAM

As the new bt-if config updation have delay in writing items
to the NVRAM, some times there is a chance of not updating
incase of battery removal happens before the actual write onto
NVRAM.

As the bonded device info is important data to store, it will
update bonded info immediately onto NVRAM.

CRs-Fixed: 568382,579638,569034
Change-Id: I9699c8225a77d9272420334b4c76b3c1df87e459
Bluetooth: Add MMS in sdp record attribute

MMS was not listing in sdp record attribute, hence add change
to set the same because we support both sms/mms in map.

Change-Id: Ia3410e6027500856af1472ef9da4c3e7f09bfe4e
CRs-fixed: 574281