hal: Fix audio playback issue on USB headset

- Start music playback on USB headset. The playback is stopped
  after 3sec.
- A touch tone is played through low latency output path,  while
  selecting the song in the music app. This output goes to standy
  after 3sec. So the disable_snd_device() is called to reduce the
  ref count on usb headset device by 1. At this point the music
  playback (deep-buffer path) is still active. But the current
  implementation has uncondtionally calls usb_stop_playback()
  which results music playback to stop.
- Fix by ensuring the usb_stop_playback is called only when the
  device ref count goes to 0.
- Fix related minor stabilty issues

Change-Id: I979423458738e68da45973751cd918d4c1a924ea
CRs-Fixed: 572048
3 files changed
tree: 9bf39c47d2301f81890034d9073dc3e182e0152a
  1. hal/
  2. legacy/
  3. mm-audio/
  4. policy_hal/
  5. visualizer/
  6. voice_processing/
  7. Android.mk