Bluetooth: support for A2DP SINK

 - added awareness of remote sep type
 - manage audio focus
 - handles stream suspend

CRs-Fixed: 580884

Change-Id: Ifbf2139baeb8b5c6e7e7622e7d9804cd1243061a
Bluetooth: Update AVRCP native method

Add Send value text response native method
in AVRCP method table.

Change-Id: I350b0380838ee9efb46af992acf56c789e726f38
CRs-Fixed: 582622
Bluetooth: OPP: Use long as file size instead of int

This patch fixes issue of problems in sending/receiving files
which cannot be accomodated in int type of Java. Instead of using
int, long data type is used, which can hold 64 bits data size in JAVA
which is suitable for storing file sizes in GB. Changes are done
in how updates are sent to progress bar which supports only int
by using the percentage of data transferred to update the progress.

Change-Id: Ie545fd483c46dd7f41da56857e67decbe7f5a167
CRs-Fixed: 583275
Bluetooth: Acquire wake lock to avoid power collapse

This ensures that target wont go into power save mode
when there is an acl is active and timer are running.

Change-Id: I9789c8ae0781a1ca4d33d364efd583ea16e9ee21
CRs-fixed: 576239
Merge "Bluetooth: Update AVRCP native method"
Merge "Bluetooth: OPP: Use long as file size instead of int"
Bluetooth: Cleaning up cursor object to avoid memory leak

A case where cursor objects are leaked after BT OFF/ON,
when it is referenced (Directly OR Indirectly). So Garbage
Collector doesn't collect cursor objects which are referenced.
Setting NULL to cursor object after closing to mark those
variable as weak reference object. Any objects memory is
immediately claimed by GC, which are marked as weak Reference.

Change-Id: Ie1665c9c9ff69b2a190025d508aa9924b36146dd
CRs-Fixed: 579016
Bluetooth: GAP: Transition to stable state based on device

This patch adds check in BluetoothBondStateMachine to transition to
stable state on reception of BOND_STATE_NONE only for device that
are in pairing state and not for all devices. Without this patch it
was observed that state was transitioning to stable state for all
devices resulting in discarding of BOND_STATE_NONE from device that
was actually in pairing mode resulting in UI stuck in pairing forever.

Change-Id: Ia860d26a5f036c13d649434246ba6dea7b9807f2
CRs-Fixed: 584102
Bluetooth: GAP: Update bondstatemachine to handle pairing scenarios

This patch updates BluetoothBondStateMachine to properly handle concurrency
scenarios of pairing while pairing is ongoing with some remote device.
Without this patch it was observed that DUT was getting stuck in pairing
when unpairing was done for some paired devices and pairing timed out with
device for which pairing was being initiated.

Change-Id: I07d2bc323aebbeada9c930eb36c9855da59dd677
CRs-Fixed: 586935
PBAP: Compare Name and ID both for getting vcard by number

This change will add a ID comparison along with the
Name before writing the final vcard entry when we get
the list through getContactsNamesByNumber
to avoid providing the vcard having the same name but
different numbers.

CRs-fixed: 583604
Change-Id: Ie2e1567a784cd3d872495a029fce6b51a39de993
Bluetooth: OPP: Add support for sending a file multiple times

This patch adds support for sending same file for which transfer is ongoing
to be added again in batch to be transferred to some other device.

CRs-fixed: 588046
Change-Id: Id6efe66974e5e348f92625f614a144dc7048e244
Merge "Bluetooth: GAP: Transition to stable state based on device"
Merge "Bluetooth: Acquire wake lock to avoid power collapse"
Bluetooth-OPP: Truncating receiving filename

Truncating receiving filename if name exceeds MAX_LENGTH. Otherwise,
files having non-ascii characters as filename are failed to receive.

CRs-Fixed: 576621
Change-Id: Ie2a60cf6bfe6bb5bfa8ab69a7b85b3cd8bd08479
Merge "Bluetooth: Cleaning up cursor object to avoid memory leak"
Merge "Bluetooth: support for A2DP SINK"
Merge "PBAP: Compare Name and ID both for getting vcard by number"
Merge "Bluetooth: GAP: Update bondstatemachine to handle pairing scenarios"
MAP: Add MAP Server Email type and instance support.

Add MSE Implementation in Bluetooth Map Profile to
support email MAS instance for EMAIL type messages.

Support MNS operations for email from single instance.

Change-Id: I89a9f63c571f3bb1cd8fc06fec39176d62e04889
Bluetooth-OPP: Cleanup OPP transfer session after Tx abort

The change will ensure that when user cancelled the tranfer while
ongoing Rx, the transfer session will be cleaned up properly.
Otherwise, while Tx + Rx concurrency if user abort the Tx and
start Tx again new tranfer session will be created only after Rx
is finished.

CRs-Fixed: 585962
Change-Id: I9b5e1c0f1748ccc47811d669ddab96ba43f424f5