audio: check for USB device state when opening in/out stream

Check for USB headset device state when opening in/out stream,
and report error if USB headset is not in connected state. That's
to handle error condition gracefully to avoid further crashes in
audio flinger.

Change-Id: Ib33489fec00ac0b5c500fc1fa2dbeb021b51cbef
CRs-Fixed: 2261252
1 file changed