This is a combination of 2 commits.

bluetooth: Add frameworks support for bluetooth bluez stack

Based on the compilation flag compile either bluetooth frameworks code
from the core directory or the bluetoothmsm directory.

When BOARD_HAVE_BLUETOOTH_BLUEZ is set to true, bluetoothmsm code gets
compiled and if it is not set default bluetooth code under core gets
compiled.

Change-Id: I5fe3ed83c5d12d5fa43c16060756228dec6b5e7b

Conflicts:

	Android.mk
	core/jni/AndroidRuntime.cpp

Bluetooth: Parse Bluetooth IOP file for Photo Vcard

By default no Photo Vcard send to Carkit even Carkit
requests for it. As remote device unable to parse
Photo Vcard. If Customer wants feature can be enabled
by Bluetooth IOP files.

Change-Id: I4a311a5c9e7ce12ebd574851bfac79ac5471808a
CRs-Fixed: 363669

Change-Id: Ifd84b19c02bb928db28aeaa24f91297ef88b0fb0

Conflicts:
	Android.mk
	core/jni/Android.mk
	core/jni/AndroidRuntime.cpp
Bluetooth: PAN: Tethering code for Bluez solution

CRs-fixed: 444230
Change-Id: Ib18028fdab1e13ab191543e1afdcfa98e0846183
Bluetooth: Implementing finalize() method.

Added finalize() in BluetoothA2dp.java for
clean up in this method.

Change-Id: I4f23333db782f8d9fc6fadb41d0b33fbe694329a
CRs-Fixed: 443585
Bluetooth: PAN: Remove interface address from list incase of error

Remove Bluetooth address from list of Bluetooth interface addresses
if exception is thrown while configuring the interface.

Change-Id: I6eaca820abfff09564a26c9521bfab7d03051825
CRs-Fixed: 434952
Bluetooth: Clear the device from list only when device is disconnected.

CRs-Fixed: 434789
Change-Id: I6be3ec672d93a3cf550324b917db579576ed8e41
Bluetooth: Modified cancelBondProcess for HID mouse

The patch properly handles the cancelBondProcess for HID
mouse devices. The device creation cancel happens when
paired state of HID mouse device is false.

Change-Id: I962e126f8435724233a78f9c700f3353d4bda588
Bluetooth: GAP: Check for pairingState null before usage

Change-Id: I4bc0cb643d58b8f77d74c4579e470deef4fe04c5
CRs-fixed: 448558
Bluetooth: New implementation of AT command parsing.

Added new implementation for parsing the arguments of
an AT command.

Change-Id: Ieb2d2c25ef2e9d676db00177b5f3931b0b6ac791
CRs-Fixed: 444286
frameworks-bt : Advertise only supported profiles in SDP database

Enable or disable PBAP and NAP profiles based on the system property
variables defined in the BT init shell script.

Change-Id: I88ac0db70d0ee2c5aad56a61ac3ebeaa03479d1c
CRs-Fixed: 405182
Bluetooth: Reset alias when device is unpaired.

Reset alias when device is unpaired to undo the remote rename
done (if any).

CRs-Fixed: 368558
Change-Id: Ibdb3319cf8eb989c3074e72aed7ef482d598a4ba
HID: Avoid listing HID mouse as paired device.

This patch avoids listing HID mouse as paired device at BT
turn ON in case device creation is completed and HID mouse
is not paired. The pairstate value is read from
getUpdatedRemoteDeviceProperty which correctly populates
the updated state for HID mouse.

Change-Id: I9cb0d9476e42139ed174400c45a4e19635b45d31
Bluetooth: Multiple gatt service for same service on the device support

Added the following support to allow the creation of multiple
gatt services for the same service on the same device:
1. BluetoothGattService maintains a serviceId which is used
to differentiate the gatt service object on the remote
for the same service
2. The service tracker in BluetoothService that maintains the
gatt service <-> callback mapping takes in object path concatenated
with the serviceId as the key so that we can differentiate
the gatt service to route the callback
3. All the asynchronous gatt client methods stores the serviceId
along with the object path as user data
4. Indications and notifications are routed to all the applications
that registered for the watcher on the characteritics
5. The characteristics watcher is deregistered only when all the
applications who registered for it called deregister
6. Disconnection is initiated on the device only when all the
gatt services on the device are closed.

Change-Id: I149f135a6e4f99cd7fd44a9cf7a059562df93ed8
CRs-fixed: 426328
Fix for Bluetooth Low Energy register GATT server feature

Changes the handling of register GATT server feature if the
server has already been registered to bluez. Returns
immediately from frameworks without checking the bluez layer
if the server has already been registered.

CRs-fixed: 463744

Change-Id: I11afef2e261ee89e9dfceadd9aed02e4577874ff
Bluetooth: Avoid deadlock in aquiring bluetooth service in rare scenarios

While doing quick BT On/Off, at times both On/Off seuence trying
to get the access to bluetoothservice object leading to this issue,
In other case while trying to update the SDP records, if event loop
get the response from the controller very fast or with some reason
thread stuck in updating SDP records this issue is observed.
Removed the syncronization for updating the uuid info to resolve
this issue.

Change-Id: I5e705702c79403870ad201c88740883ece415cef
CRs-fixed: 452659
Bluetooth: Move to proper A2dp state at BT OFF.

When BT is turned OFF, A2dp might get stuck in
DISCONNECTING state. The patch ensures that A2dp state
is properly moved to DISCONNECTED.

Change-Id: I0038732542ad3d5b7b33b9536b2ec9a470919d4b
Bluetooth: ignore state change update from second streaming device

During A2dp playback Ignore state change update from second A2dp device
When there is a connection request from a second a2dp device this change
would avoid wrongly resetting the state of the streaming a2dp device to
improper state.

CRs-Fixed: 414094

Change-Id: I25bc5430ff37603502f4cb6072dbe5476e2baf13
Bluetooth: Add break to avoid wrong fall through

Add break which is needed to avoid wrong fall through while
processing Obex Permission command.

Change-Id: Ifa790ef14751168ad78246514645f864af0c2e6b
CRs-Fixed: 436931

Conflicts:

	btobex/javax/btobex/HeaderSet.java