Prefer 16bpp formats for opaque bitmaps

Configure BitmapFactory to prefer RGB565, which will make it
use that format for all opaque assets loaded by it with standard
settings. Toggle dithering flag in strategic places and reenable
16bpp drawing cache, to speed up software UI rendering.

This generally helps with reducing memory consumption on legacy
devices, and usually does not result in reduced visual quality.

Change-Id: Id1b7e0529461d23213e31c25b74d4da5d08f0855
qcom-fm: add support for mr1 based fm solution

Squashed commit between:
https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=commit;h=27086d06dec240e8915580208197ab7169ec498e
https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=commit;h=a776f068da4f45f79d42ce7f9ceb6b4f3f18b8ee

Change-Id: Ia6a38a1ad300d9179eead13a117f56017a026826

Conflicts:
	data/etc/platform.xml
qcom-fm: audio: add support for fm feature

Change-Id: Id48a52ceb7359deb65d4a69e664b22ed80cf997c

Conflicts:

	core/java/android/content/Intent.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

audio: fix for FM mute issue

- Add STREAM_FM in mMuteAffectedStreams
  so that FM stream can be muted
- Add STREAM_FM in STREAM_NAMES

Change-Id: I6c604e1a20a466a97ca4246260c0b1a7ad9112d2
CRs-fixed: 441132

Conflicts:
	media/java/android/media/AudioManager.java
	media/java/android/media/AudioService.java
	media/java/android/media/AudioSystem.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Revert "This is a combination of 2 commits."

This reverts commit 60d96f8767bdde9a1a5cf0a799c59d9e63a100c7.

Conflicts:
	data/etc/platform.xml
frameworks: add support for bluez stack

This is a combination of 19 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
	data/etc/platform.xml

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

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: Added AVRCP1.3 intents in mediaplayer.

Added posting of Metadata Changed intents to BluetoothA2dpService
for updating MediaPlayer status like STOP, PAUSE, PLAY, FWD_SEEK,
REV_SEEK along with metadata of the current song.

Change-Id: I47bbea35c982d07fecdbb9245cc48af58fb1d78a
CRs-fixed: 443134

Conflicts:

	media/java/android/media/MediaPlayer.java

Bluetooth: Update the PLAYSTATUS and METADATA to remote device based on
           Actual state of Music App.

Registered for PLAYSTATUS_CHANGED intent which is provided by Music App
and based this information BluetoothA2dpService is  updating the Play
status and metadata to Remote device.

Change-Id: I5fe865fcdde3e0fd2442d0629e465711696d977a
CRs-fixed: 443134

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

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

Bluetooth: Cleanup userids array to avoid null pointer exception

This fix null pointer exception during multiple gatt services.

CRs-fixed: 485789
Change-Id: I3d6061ed0a817cdfb4ab8d526c71c569edf2f929

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 481305

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

Bluetooth: Reverted changes to avoid LM_SECURE option for BT Socket.

The LM_SECURE options sets the SECURITY_HIGH for l2cap socket.
Previously this option  is avoided for meeting SAP connection
requirements. As this is required for CTS validation, reverting
back the existing google implementation.

(cherry picked from commit 0b0c7c4cb1c3c557d2d45aaa7b9c21347a338c75)

Change-Id: Ibbeb57bf5984ec0af50441562de70b4ed744a0f0
CRs-Fixed: 387173

bluetooth: Fix crash in bluez handler

Fix crash in event handler loop when the underlying dbus
mechanism is not available.

Change-Id: I26670f9d5d0fa738a3c89f1f7d603a307c9d3e04
CRs-Fixed: 471242

Bluetooth: JNI verbose log fix

Fix to avoid compilation errors after enabling JNI verbose logs.

CRs-Fixed: 475950
Change-Id: I3e2d54b0f5f8e0c005742adfc2ffc6f0ac33a33f

Bluetooth: Create A2DP handler with looper

Found an exception due to A2dpHandler whenever Skype tries to load the
MediaPlayer to play Incomming Notification. Associated A2dp handler with
looper.

CRs-fixed: 452283
Change-Id: I73d3a5ff7728383e89da7252ea8db383014feab8

Conflicts:
	media/java/android/media/MediaPlayer.java