hal: SSR support for pcm playback,pcm record usecases

- Added SSR event handling support in HAL

- Added support to drop incoming pcm data for pcm playback
  usecase during SSR

- Added support to send dummy input(mute/zero buffer) for
  record usecase during SSR

Change-Id: I158b62fa443bb523091128fe1308c9a9b1415502
Audio: Enhance logging in AudioPolicyManager

Enable msg logging
-To print playback clip attributes
-Offload supported or denied

Change-Id: Ifafb8c01ecca41aa2e09a134123d56a695494db4
hal: improve logging.

-log to print open/close/standby of out/in streams
-log to print the the device switches

Change-Id: I1b3bf3d6ba19faa4df804f781fc15c0f96a5b80f
hal: Fix teardown during back to back pause/play of WFD session

- When an active WFD session is paused/played continuously from
  the WFDClient app, the session tears down after a few iterations
  if touch tones are enabled.
- The output device is switched back and forth between speaker and
  proxy when the session is paused and played continuously.
  When this happens, sometimes, there is no backend to write the
  low latency output which results in pcm_write getting blocked.
- Fix the issue by not routing the low latency output to speaker
  if the previous device is proxy.

CRs-Fixed: 630234
Change-Id: I6bbe82badd3d5ee857e920430304c3a45c5b44c7
post_proc: improve logging

Make logs more meaningful and remove
ones not necessary.

Change-Id: I9562cf34a5dee406b1c0347a9004db08de9cd5df
post_proc: disable Bassboost and Virtualizer for USB_ACCESSORY

USB_ACCESSORY is not intended to be applied with SA+ bassboost
and virtualizer, so add into invalid devices list.

CRs-Fixed: 659191
Change-Id: If1f3421f9935ce624dc21895d9244d36d195b2bd
post_proc: fix post and pre process KW issues

KW issue fix includes:
- handle memory allocation failure
- array index boundary check

Change-Id: I083952ba58d348a5b650601a83e6f492b0d686bb
audio: Force route call on HAL during device disconnection

- When a wired accessory is connected/disconnected,
  setDeviceConnectionState updates the current device
  only for active outputs and also makes the corresponding
  route call on Audio HAL when the current device is not
  same as the previous device for the active outputs. As
  inactive outputs are not updated in this case, sometimes
  audio policy fails to notify device change to HAL.
  Specific scenario is mentioned below

- If headset is inserted when touch tones are disabled
  and music is in progress, LPA/tunnelled output is updated
  with headset as its current device and also respective
  route call is made on audio HAL. But low latency output
  still has speaker as its current device because it is not
  active. Later, if music is paused and headset is removed,
  setOutputDevice does not make route call on Audio HAL
  when touch tones are played. This is because the current
  device and previous device are same(speaker) for low
  latency output. So Audio HAL tries to play the touch tone
  on headset when headset is not connected.

- Fix is to force route call on HAL after every device
  disconnection irrespective of current and previous device
  being same for the specific output

Change-Id: I80d799718c980d0422d4e5f7015fcf16f001fda9
CRs-Fixed: 627903
audio: Close the file descriptor in error scenarios

 -In the scenario where the USB headset and proxy device
  sample rate dont match, error was returned without
  closing the file descriptor .So, the next time USB
  headset is inserted , the /proc entries are not created
  which results in the USB headset playback not started
  as the capabilities cannot be read.
 - Closing the file descriptor in the error scenario fixes
  the issue.

Change-Id: Ie45327f04cc7fff6dbcbe1268a7f34793e89641b
Merge pull request #4 from CyanogenMod/cm-11.0

cm11