libhardware: Add allocSize hook function.

Add allocSize hook function to support the custom buffer sizes

Change-Id: I0d55195cbc02af1001d6164ce8fd55380750c029
(cherry picked from commit df05397a51e2d52d45f74932212d6ccf53b044bd)
(cherry picked from commit 29abae57e4295d82297bdad6621d6795679672f3)
(cherry picked from commit b33f1d1897017a50c6fa7b6c1275449196f45e63)
libhardware: Add keys to support FM

Add keys for FM device and FM volume

Change-Id: Ib26df18a72f96bf19d577d99e93296a37f04ed7b
(cherry picked from commit 1dd30a530cf3b595d9877d0d15739b2b1b76889a)
(cherry picked from commit 2599b75a58206332ea00206171dfff078bda20ff)
(cherry picked from commit 0a3f3c974406228d6541a2df6d38b42fdbfd790b)

Conflicts:
	include/hardware/audio.h
audio: Add QCOM feature support for frame size

- Add support for QCOM audio formats in audio_stream_frame_size
- Send correct channel count for voice call recording
- add support for VOIP
- reference change  I7a2f5a25c7571b3abf4cedb9d9104681304d1629

Change-Id: Ic1dc22571d4860f143efbc8a24f2933eae3c1de9
(cherry picked from commit 29ee43bc11557970569df2b192fd40fa41683ab2)
(cherry picked from commit ff693eda23e0009b0864e1b31ba1cbf49691c449)
(cherry picked from commit 4c6d213db8940842d0b9ab6b05fcd99116740965)
Bluetooth: Add support for set_priority for HID Host

This patch adds support for set_priority for HID Host. With this new
method, btif layer would be informed of remote HID Device priority
and would help in early rejection of HID incoming connection in case
User on DUT has unchecked Input device from Application.

Change-Id: I0c1ac7c8ad010b8d7e8aa5653e69568a45f4af92
CRs-Fixed: 532234
(cherry picked from commit e5987b7ab32b7b887693dbfd28ebfe0aac5f9f2f)
(cherry picked from commit 051d9de3e4f413fbd1c19dca69a461330267fd83)
(cherry picked from commit 59cb7a79c557ed355b02bc497443b425623ae036)
Bluetooth: Added new prototype of HFP feature bitmask.

This function will allow to let the BT stack use
the features supported by the Bluetooth HFP app.

CRs-Fixed: 482189
Change-Id: I9d015562e310ed2901ada91e692083dde7ac4614
(cherry picked from commit cad7f788e01e07659a605a1f61095a503f68563e)
(cherry picked from commit e0e16d9f105400b3339aa48ea99131fce1570029)
(cherry picked from commit 2d6f0d249c89a5cd9ece75a74bfd96c5c3a32068)
Bluetooth: Added function prototype for codec.

This function is used to notify the BT APP
about the codec negtiated.

Change-Id: I058a9b6409341d3fc849de1386174207bd9df1e3
(cherry picked from commit cce5c76bfa42c54e15d6eb3bd43ae9cea82c462c)
(cherry picked from commit 3add2cdff0fd82f887925ff6f26211c8ee6d0c07)
(cherry picked from commit ed834a7088edaa64aa48912abf15cc6ae510d766)
Add masks for BeiDou and Glonass

Added masks to the GPS interface
for deleting assistance data from
BeiDou and Glonass satellites
CRs-fixed: 498642

Change-Id: I3887338ffcbcd3977473354df9c77dbe834ac45d
(cherry picked from commit 0fc8bdf7b6841ec7395df2ded434a1009e36992d)
(cherry picked from commit 5e64b05c36a9eed4708013ab24bec01ce76d6f41)
(cherry picked from commit 70b149dc90d08e8f9a302445bb229bfbe0a8b15c)
libhardware: Add MSM string parameters.

- Add MSM specific string parameters for
 VoIP, Fluence, SSR, A2DP and ADSP

Change-Id: I3b0dee240c507c4cad14529e4a79404d6902be7a
(cherry picked from commit 24f52207794e7f2c7ab0cbf8cfd933d2f11adf1e)
(cherry picked from commit 4709458913009c131d6f7a3716c72c3f180eca8e)
(cherry picked from commit 3e57aadd82c38d87522121f41e184cea34cb3653)
Bluetooth: SAP: Header files changes to support SAP on Bluedroid

This change consists of:
Header file changes for Bluedroid SAP profile

Change-Id: I3c685967d6ed154f57fcd6f30b2402af9f42ec3f
(cherry picked from commit ff4940b8f32511fb870facc4eb2c36fb27890de0)
(cherry picked from commit d60cdf06d3220127e05a4f0db8fcda8c452b5637)
(cherry picked from commit 8bcadb8fef1f42a930b6bcf44c51cb8da58e9383)
libhardware: Enable MMAP interface in USB Audio HAL

Allow USB Audio HAL to write using MMAP interface
to support USB Audio AoA feature.

Change-Id: If23d2b618277ab64853fc1d778767a95482bedbf
(cherry picked from commit 1dc50e2b4d2bbac5d39edfd408d011cfaf4cd82b)
(cherry picked from commit bff3e5a4d2d0e61e6c35cfb3ef66be51ae98b3c8)
(cherry picked from commit ba5d429fe4817c48c089d34954daea21f321bf11)
libHardware changes to support Avrcp1.5

Provide support for Avrcp1.5 so that remote CT is able to
browse the list of available media players on DUT and select the
media player from the available list of players, from remote.

Change-Id: Ib804efc3a42d14f302d0d1eec7ab34c9f13b5c7d
(cherry picked from commit 930dea418889c07a9ee3e6cfba3a57f7ef79df9f)
(cherry picked from commit 611745ca017c72079d4a3e7a2f7e953cd00350d5)
(cherry picked from commit 169a7fa2f35e68b5cc9a3f924a94b05a01b18614)
libhardware: Add ifdef around allocSize

 * Non-QC devices with prebuilt grallocs hate this.

Change-Id: I57ce7547e99ec0cf40c4f05f3742348dec4e2d9d
libhardware: Add ifdefs for QCOM audio features

Change-Id: I9d8fd69c1865d8746850f676a8091a968a42750d

Conflicts:
	include/hardware/audio.h
libhardware: Modify ifdefs for legacy DirectTrack

Change-Id: Id3a8adc3bd3b8fe5973e359b5268671f6fd26cd4

Conflicts:
	include/hardware/audio.h

Change-Id: Id3a8adc3bd3b8fe5973e359b5268671f6fd26cd4
libhardware: Add fix for offload playback.

-Offload mode requires frame size to be unity.
-Tunnel encode changes results in a invalid frame size being
 returned to audio flinger.
-Add 24 bit PCM format as exception to linear pcm.

Change-Id: I23d1960b0a493da20f48de788bb13e6f055ebe03
usbaudio: Add QCOM ifdefs

Change-Id: Ifd7cc6e1b7615718ae6eb04b3b9dd850148009a3
usbaudio: Make the USB audio HAL actually work.

 * Set a default device if none is set.
 * Shush some logging.
 * Only use the mmap interface on QCOM devices.

Change-Id: I790a6733e85b169e645e020fa92608a0d4fea3c2

usbaudio: Provide a way to hardcode the card id

 * Some devices will have secondary sound cards for things like SPDIF.
 * Let's provide a way to hardcode the correct value for now until we
   have framework support for doing this correctly.

Change-Id: I6f3396692f1acc1602491e3a3befea8e04b6c9cf

usbaudio: Fix output device routing

Fix issue with commit a35e783 causing the output device to reset back
to the hard coded value of CARD_ID after a new output device is
specified.

This happens because out_set_parameters() receives a single "routing"
key/value pair just after setting a new output device. The if/else
statement would then cause a reset of the output device back to CARD_ID
because the "routing" message does not contain a card or device id.

Change-Id: Ib7c7eb7ef675ae371033a7ae7ce73782cac2c898
usbaudio: Fixing return value from out_write

-pcm_mmap_write() returns 0 for successful write and a negative
error number for errors
-out_write always returns a positive value
-fixed return value as per pcm_mmap_write() returned result

Change-Id: I6bbca5df9a1eb9ceae492a8cf5f478189cedbb12
CRs-Fixed: 564094
audio: add set_parameters for listen hal

Add listen hal specific set parameters function so that Listen
service can call Listen hal directly, by passing audio hal. This
is needed since set_parameters call in audio hal does not guarantee the
correct return value is returned for any parameters set.

Change-Id: I647b9e7f841c8157e4eb597655166ea863a00925
libhardware: Add audio power hint

Change-Id: I5b03cc060356da23b6941c5937ef217c70dbf6dd