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: 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
Merge "Fixes random host disconnection after establishing connection"
Merge "Fixes pairing and unpairing issues with BLE devices"
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
Fixes BLE HCI commands concurrency issue

Removes HCI LE Read Remote features command call
to prevent the concurrency between this command and
HCI LE start encryption command.

CRs-fixed: 517330

Change-Id: I6445ab8095a4261c2a3f84acea1c546e6924f50d
Merge "Bluetooth: HID: Add support for Set Idle and Get Idle commands"
Merge "Bluetooth: Add trust Device feature in bluedroid"
HID: Initiate SDP if remote HID device is not in List

This patch tries to initiate sdp to devices which try to iniitate
pairing and then immidiately afterwards sends HID Control L2CAP channel
establishment request. Since device was not added in HID Database, control
channel request was rejected, resulting in disconnection from remote hid
device. Now we try to initiate SDP after sending L2CAP conection pending,
so that if successful device record is updated and then we accept L2cAP
channel by sending connection successful.

Change-Id: I7c3907a38e819bbc83e5b03c52560d8da7cf8073
CRs-Fixed: 502447
Bluetooth: Initiate RNR for HID Pointing Devices if no name.

This patch initiates Remote Name Request for HID Pointing devices in case
name is not known before initiating HID L2CAP Connection. Once remote name
is retrieved, name is stored in NVRAM and upper layers is informed
of name of remote device.

Change-Id: I6ecf07c222f804dcfcedd84fc1ff26ffe5bcbdc8
CRs-Fixed: 519771
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: 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
Merge "Fixes BLE HCI commands concurrency issue"
Merge "HID: Initiate SDP if remote HID device is not in List"
Merge "Bluetooth: Initiate RNR for HID Pointing Devices if no name."
Check if BLE is enabled before using it

Change-Id: I48a47d86200ff912cb529ad28d000142914c6c0b
Merge branch 'jb_mr2' of git://codeaurora.org/platform/external/bluetooth/bluedroid into cm-10.2

Change-Id: I374386a14075af41ae1b0b0c313dd9b7645b4032
Merge remote-tracking branch 'cm/cm-10.2' into jb3