hardware_legacy: allow alternative vibrator implementations

The native vibrator code in libhardware_legacy assumes the vibrator
is always controlled by inputting timers into sysfs (at
/sys/class/timed_output/vibrator/enable). This isn't necessarily true,
there's an upcoming device which has the vibrator controlled by ioctl()
calls.

This patch lets the device configuration specify an alternative
vibrator implementation throught the variable BOARD_HAS_VIBRATOR_IMPLEMENTATION

That variable should point to a sourcefile that implements the vibrator
"int sendit(timeout_ms)" function, like this:

BOARD_HAS_VIBRATOR_IMPLEMENTATION := ../../device/vendor/model/vibrator.c

Change-Id: I78d60480f87ef00a0bab096d7f42e47501def936
audio_legacy: Convert channels to old enum
ifdef usage of legacy audio enum conversion

Without this, devices compiling from source using this HAL layer
as a static whole library will break as they already use the new enum.

Change-Id: I710dbc8b013edd5e59a04a0956c69b49da35b5ba
wifi: add suport for WIFI_EXT_MODULE

we need WIFI_EXT_MODULE to load sdio.ko module for ti wlan

Change-Id: Ie8e746c1e69712be78d420d8e8ae8b015564a03d
wifi: Add option for a device-specific wifi

This patch adds TARGET_CUSTOM_WIFI which can be used to replace the
standard wifi.c with a custom implementation without breaking things
for devices that assume default functionality. (Derived from
Gingerbread:566d2f2)
wifi: fix a bug when WIFI_EXT_MODULE_NAME is set

Missing braces will cause wifi_load_driver() to always return -1.

Change-Id: I9996633ae87cd58dd3f2b6314d8049f61594a02b
wifi: add a new "loading" state

Set wlan.driver.status to "loading" in wifi_load_driver to allow
external action being triggered by property change.

Change-Id: I72004b8b5bc711ea83cc7ae4b6a39382c05cb02f
audio_legacy: ignore screen_state=off/on parameter

Change-Id: I8b22f9e494bff1db84a493315a1c716d45f3bab6
wifi: Add AP specific API

This allow the use of a different kernel modules configuration when
initializing Hotspot.

wifi: allow dynamic override of module args

wlan.module.arg and wlan.ap.module.arg properties can be used to
dynamically override wifi and hotspot module parameters.

Change-Id: Iaae1a2db6dc7ee07a78f1f2718bdafc73528c4b1
libhardware_legacy: Add enums to support for FM and ANC features

- Added required AudioSystem enums to support FM and FM on A2DP
  features
- Also added support for ANC and FM Tx devices.

Change-Id: I2ec25f3b35d9ff6cd2e8a237eef439c8bcd10ddf
audio: Don't use QCOM_HARDWARE when AUDIO_LEGACY is active

The older (GB) blobs used with AUDIO_LEGACY do not support the
new enums.

Change-Id: I958e27fe02b79ef795fb767c4dd3f87f65378092
hardware/libhardware_legacy: Add interface function for LPA and FM

- New interface function prototypes are added for LPA and FM
  features

Change-Id: I1e7cb94668e2999b055acfa0c31652d5d1e719c1
libhardware_legacy: Add support for audio session

- Allow audio sessions to be opened and close
- This is required for LPA

Change-Id: Iff7192a0853dbb394b8c34962f5fbf70c9bfd6bb
libhardware_legacy: Add PolicyClient APIs for FM feature

- Added AudioPolicyClinet interface functions required for FM

Change-Id: I73f0cf6f5aca061f49e514c4a241aa6fbdc11252
audio: Don't use QCOM_HARDWARE when AUDIO_LEGACY active (more)

This completes the work started in
commit b054def640e54999a3173d59624abbb2cf2ac8b4
    audio: Don't use QCOM_HARDWARE when AUDIO_LEGACY is active

    The older (GB) blobs used with AUDIO_LEGACY do not support the
    new enums.

Change-Id: Ieb9e78011b4b6cde43577dda03fd2c003beff052
hardware/libhardware_legacy: Use direct output for VoIP feature

- Added changes in AudioPolicyManagerBase to use direct output
  instead of hardware output for VoIP RX path

Change-Id: I7aa32970dacf1cf06856b51271f020df59186afe
libhardware_legacy: Send correct channel mask in voice call recording

-Channel mask getting over-written for input source in voice call
 recording case
-Sending correct channel mask now

Change-Id: I57159ec5a870eb10b1feb985909aea33b0bba8f7
libhardware_legacy: Use direct output only for voip call

Voip session is getting opened instead of recording session
for some applications as it selects direct output device.
Avoid this by adding a check so that direct output device
is elected only when phone state is set to voip call mode

(cherry picked from commit 7c3da2e8407c88dba52911359ef138dfb8f7224c)

Change-Id: I7ecf326b80a3a92d2107c55bad5f5a666beb5079
CRs-Fixed: 345217
ensure the driver is loaded before changing fw path

In some cases (like starting Wifi Direct), the kernel driver
may not yet be loaded. The driver must be loaded before we
can load new firmware. This change loads the kernel driver if
it has not already been laoded.

Change-Id: I4eb9dda725a5c61dcd323260f22dd1ace5c492a1
wifi: Choose correct nvram file on Samsung hardware

 * Samsung's US devices have at least three different Wi-Fi variations.
 * The kernel driver writes out the variant in /data/.cid.info
 * macloader will prime this file
 * Read the file and choose the correct nvram_net.txt

Change-Id: I0e6aec7b622b4b90d849e63928e0352d0d730d8a