Bluetooth: Add SDK apis for Wipower and Peripheral feature

changes needed for Wipower and Periferal features.

CRs-fixed: 587811

Change-Id: Ibe73124daf78c79498fd1a6cbbcd75a88006c688
Bluetooth: Added new key to store last connected A2dp Sep type

Changes made to add new key and API to store, retrieve the last
connected A2dp Sep type using Content Resolver.

CRs-fixed: 599358
Change-Id: I2648603cc456921ec1896fb498b602416bd79e72
OBEX: Reduce Obex MTU size for A2DP or SCO concurrency

Reduce Obex MTU to 8k from 64k when OPP send is tried with
SCO / A2DP streaming in progress, so that the continue
response for first complete Obex PUT packet is received
from SOC within 50 seconds time frame.

CRs-Fixed: 571865
Change-Id: I1eae114f57f2a92ee4b26c82d8f55fafe02775b8
Bluetooth-OBEX: Reduce the MTU size if default OBEX MTU > 8k

Add a check for default OBEX MTU. If MTU is greater than 8k and
setMTU flag is true then reduce the MTU to 8k.

CRs-Fixed: 613931
Change-Id: I5785fd372241f682427ea3aca0b56ac747820d52
[1/3]frameworks/base: add "Accept all files" option for incoming files via Bluetooth

This patch defines a key to store the option value in Settings Provider db

Change-Id: I993d7ec77b49f608a5a17e5a8516e52fc5d82946
Bluetooth: Add Power apply enable event handling

Add Wipower Power apply enable related event handling
in frameworks

CRs-fixed: 612628

Change-Id: Iceb0cf8297ad0ab7080c0c494c1404127ff0258a
Bluetooth: Fix to avoid framework reboot during monkey.

A case where monkey is running & sometimes framework is
disconnected due to unhandled java Exception during the
binding of DUN, SAP, HID device & PAN service on unsuccessful
binding. So it never handled. Handing java exception while binding
DUN, SAP, HID device & PAN  services to solve this issue.

Change-Id: Idea710593a3f9496305f636042605303e73e7749
CRs-Fixed: 564709
Bluetooth: HID-C: Add support for error parameter for reportError

This patch adds support for error parameter in reportError providing
better flexibiltiy to application to respond to errors for Set Report
received from HID Host.

Change-Id: Ieada7be8a6a91d310f20849af9e5a9b04766f4a5
CRs-Fixed: 595139
Bluetooth: Fix to avoid framework reboot during monkey.

A case where monkey is running & sometimes framework is
disconnected due to unhandled java Exception during the
unbinding of HID device service on unsuccessful unbinding.
Handling java Illegal Argument exception while unbinding
HID device service solves this issue.

Change-Id: I61a5620e756119d25f2a235e67d6404b216f4cbf
CRs-Fixed: 601533
Bluetooth: Cleaning up sap service object to avoid serviceRecord leaks

A case where script is running to do BT ON/OFF 2000 times. Sap service
class object is leaked while turning OFF BT, when it is referenced
(Directly OR Indirectly due to its member variables). So Garbage
Collector doesn't collect class object which is referenced. Setting
NULL for service class object & service connection, while cleaning up
those variable to mark as weak reference. Any objects memory is
immediately claimed by GC, which are marked as weak reference.

Change-Id: I905d1e542c159c8f9addcb8491aee900697c9006
CRs-Fixed: 591180
OmniTorch: update app_package_name to the new torch app

Change-Id: I09fb71a870c64b3df282da5bdb07581f3852cf22
Signed-off-by: Hieu Phan <aznrice2k4@gmail.com>
Bluetooth: Adds check to verify Bluetooth adapter state

This checks whether bluetooth is turned ON or not in
BLE stop scan process. BLE scan apis are called from applications
so need to check if BT adapter state is ON to avoid Bluetooth
crash

Change-Id: Ifc472be9b3f8baf978d6cdca2e4743a75b951635
CRs-Fixed: 634617
BT: HF: Control verbose logging at runtime.

Verbose logging in BluetoothHeadset can be
controlled from adb shell.

Change-Id: If63974402a4fc91065c8007a224388af12f49cf7
CRs-Fixed: 601899
Bluetooth: Fix for FileDescriptor leakage causing ANR

Fix to close the native fds gracefully. detachFD has been removed
in order to close the native fds

Change-Id: I6afca60bcf6adc82ad6a63d8706267d8ed3bd579
CRs-fixed: 623575
Increases Gatt connection timeout value to be 30 secs

Some LE devices take more time to establish
LE connection. This change increases the
connection timeout value to take care of
this scenario.

Change-Id: Ie4cc79b53301f230553df02afd5d64dec637fe5d
CRs-fixed: 582556
Bluetooth: Validate input parameters of gatt characteristics

If the input parameters of gatt characteristics are not valid
return false

Change-Id: Icf44439992cb068339f7a4c4e50a3f28c25db6ce
CRs-Fixed: 534763
Bluetooth: Fix PXP LPP app link loss reconnection

When BLE link loss reconnection happens,the host is
not able to send Vendor specific commands
to the controller to start monitoring the RSSI
values.

CRs-fixed: 597822

Change-Id: I436889fae7f7d42c4f532690b726271ffc136e94
Bluetooth: Handle exceptions for bluetoot socket read

Handled IO exception in read function of BluetootSocket,
and also introduced a null check for mSocketIS.

CRs-Fixed: 605606
Change-Id: Ic948c72269e0de486a8f49163830528b002198ff
CamcorderProfile: Add 4k timelapse encoder constants

 4k encoder constants during timelapse are added
 for the 4k timelapse use case.

CRs-Fixed: 642013
Change-Id: I901fa362242477dad84130d23055815cdfee6167
Finish fixing Zygote descriptor leakage problem

In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID.  These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change: dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected.  The CLs need to be approved
together, lest the build break or the software fail to boot.

Round 2: indent change

Bug: 12114500
Change-Id: I280a10e7ce90a70244703113c0ff9ede85b0269f