audio: fix problem of routing device 0 after A2DP play

This patch avoids abnormal operation in AudioStreamOutALSA::write().
When BT device is turned On/Off, if routing device is 0, then pcm open
will be failed.

- A variable "mDevices" is set to "0" when device is switched to BT A2DP
from speaker during playing music.
- If variable "mDevices" is "0", when PCM data is writing to buffer
in A2DP stream, then a routing device is set "no device".
- And when device is switched to ALSA stream, and PCM open will be failed.

This causes media crash as killing ALSA.

Change-Id: Id416bed3f59bfbe857b2a9fd504f3f18746fb4cd
1 file changed
tree: c5ed0b64914fb3b5c412cb2d018d8d26fa5df493
  1. alsa_sound/
  2. libalsa-intf/
  3. Android.mk