Handle CL opening state in bta_jv_free_rfc_cb

When the local device is openning an rfc channel and is being closed
before it's opened, we should close the channel instead of ignoring.
bug 11299049

Change-Id: I702500d489c8b3d3764e36340106433232a127c0
Support USB HCI

Issue: AXIA-1459
Change-Id: Ie4cc5766446774a0bae3bbf7d9baa5f44e814f59
Signed-off-by: Ravindranath Doddi <ravindranathx.doddi@intel.com>
Signed-off-by: Krishnan V <krishnanx.vaidyanathan.venkitakrishnan@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
Update USB support for 10.2

Change-Id: Ia476759fe3b996682e617844571de782eadbdb74
usb: Abort writes if device is absent

Fix crash loops when a device "loses" a removable USB adapter between
boots and the service was left enabled

Change-Id: I4ab7cebb631438bf092d55da1ff7218c2b8d096b
Fix up for 4.3

Change-Id: I4d2947281195d62444c6913a709e4d302dc26b19
Merge remote-tracking branch 'cm/cm-11.0' into HEAD
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
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.

Change-Id: Ia1779293b643c22d3f754c7f405646d42eb94963
Merge tag 'android-4.4.2_r1' into HEAD

Android 4.4.2 Release 1
Fix uipc.c to never pass -1 to FD_ISSET.

The behavior of FD_ISSET when passed -1 is undefined.

I checked all calls of FD_SET and FD_CLR in this file, and they all
seem to be correctly guarded. None of the FD_ISSET calls were, so I
added a SAFE_FD_ISSET macro to return false when passed -1, which is
presumably what the callers intended.

This allows Bluetooth to be enabled on a device where the C library
aborts if passed any out of range fd.

Bug: 11047121
Change-Id: I261404a5a80884d5e9edab8beb3c93969113dc76
Fix array shifting logic of updating bg devices list.

Assume there're bg devices [a, b, c], and a is removing. The code updates the
array to [b, c, c], which the right most remained element of bg_dev_list is not
cleared after shifting and makes it duplicated.

Change-Id: I048f6526a5de32aa82ef0eb22df7d5f8b937171b
Signed-off-by: Ting-Yu Chou <janus926@gmail.com>
restore our history

play backup back

Change-Id: I73fdd2b37394d08ebaae547ef4d4bea33da60b50
Fix BT failed to enable issue.

When BT startup, bt_hc_worker thread will send BT_EVT_PRELOAD_CMPL
to btu_task. However in bte_main_enable, it first calls
bte_hci_enable(), then creates btu_task. So it may send BT_EVT_PRELOAD_CMPL
before btu_task created. Change creating btu_task before call bte_hci_enable
to make sure btu_task already created successfully before send
BT_EVT_PRELOAD_CMPL

Change-Id: I2a784234e0fcf3a95743978f2a8c60aa30fd83be
Author: Tan Jingjing <jjtan@marvell.com>
Signed-off-by: yuwan@marvell.com <yuwang19860130@gmail.com>
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.

Change-Id: I9699c8225a77d9272420334b4c76b3c1df87e459
Bluetooth: fix sniff issue with multiple rfcomm connection in same ACL

When there are multiple rfcomm connection with same appid and peer bd
address, we were clearing jv pm control block in addition to closing
connection to service with registered app id. Since appid is common
across all the client and server app registed to jv. we were clearing
entire connection to service for this appid and peer bdadres which was
corrupting sniff logic, when another rfcomm connection exists with same
peer bdaddress. So avoiding closing of connection to the service when
multiple rfcomm connection exists in same ACL.

Change-Id: Id71ef5f7f0e00f1bda3b70a4826c31bef46caafc
Fix bug in PAN code where no new PAN connections can be made.

If you call PAN_connect() followed quickly by PAN_disconnect(),
you won't be able to establish any additional PANU connections.
This happens because the connection never has a chance to make
it into PAN_STATE_CONNECTED and num_conns only gets decremented
if you disconnect in the connected state. As a result, subsequent
calls to connect will fail because the stack still believes there
to be an existing connection.

Change-Id: Id24873828ca4f517496cb19a44993d0e8e837a1e
Merge remote-tracking branch 'github/kk4.4' into slim-master

Conflicts:
	btif/src/btif_util.c
	main/Android.mk