bluedroid: Add wiimote pairing support

Change-Id: Ie1e9fa445cc1967679f3d74277df4c594fca5330
Fix calls to pthread_setschedparam.

When the scheduling priority is set to SCHED_NORMAL, you may not
specify a non-zero priority. The current implementation does
exactly that resulting in the call failing and returning EINVAL.
This change ensures that a priority of 0 is set when the desired
scheduler policy is set to SCHED_NORMAL.

http://b/12304174

Change-Id: I945cae175b7bdd29dd8fc130ff6396b88ec33fcb
Revert "bluetooth: Do not sleep when you have already overslept your tick"

 * Obsolete, and is causing more harm than good. Reverting this patch
   solves the sporadic AD2P timer jank.

This reverts commit a73420d385097af6212f94da2d7020811a8bb580.

Change-Id: I4800e975a2183e8202c002e06facf3b2133158ea
Raise the transmission priority for a2dp media channel to high

Raise the transmission priority for a2dp media channel to high
so that when a2dp streaming runs simultaneously with some other
b/w consuming operation such that file transfer over BT, a2dp
media link is given more priority over other channels so that
host does not delay sending the media packets.

CRs-Fixed: 628669
Change-Id: Iea9d7008cfe83978c6e1bbb0b99b7423ba9cd083
Bluetooth: Avoid premption while modifying gki timer queue

Addition/Removal of timer nodes to the timer_queue happening
without protection,
When both Addition/removal happens concurrently there could
be a chance that remove timer might have deleted the node
and the same might be getting accessed in add timer while
adding the timer node to the list, this could lead exception.

Added changes to synchronize both addition and removal
of timer nodes from timer queue, so that addition/removal
happens sequentially.

CRs-fixed: 647281
Change-Id: I24f6476e026b071145019164a6f122b5ab70cb51
A2DP HAL: Update maximum Audio buffer size

Due to Audio buffer equal to socket buffer size observed A2dp
Chopiness randomly because of socket write blocking for long
time. Update maximum Audio buffer size to 3072 bytes.

CRs-Fixed: 648712
Change-Id: Idcb77a6153d4c790dba652277063bebf7e9c7c3e
A2DP HAL: Delay open_output_stream

Delay adev_open_output_stream to ensure that the Headset is
in proper state when START is initiated from DUT immediately
after the connection due to ongoing music playback.

Change-Id: I79a895a85ac7d37208192acf9064fd5c979dd28b
CRs-Fixed: 647163
A2dp: Reduce out buffer size to accomodate 8 PCM frames

Reduce a2dp audio HAL out buffer size to 8*512 bytes to allow
audio to write lesser amount of data to A2dp HAL.

CRs-Fixed: 649937

Change-Id: I3e762bf8d269eb47a85bb4bc727f0365e8a48844
Fix "Bluetooth: Handle sub system restart gracefully"

 * Do this only for Qualcomm hardware.

This reverts commit 7062c3daf85b6b8224c3b065905c93e88c690316.

Change-Id: Idbe1cd8a57c31e6388f0fd1794c86de6564886c3