hal: check for usb card state before setting in/out device

During record, audio record usecase still uses usb-headset-mic
as input device even if usb-headset is plugged out. It causes
record fail and mute issue happen.

Fix it by adding check for USB card state, and routing input
device to handset, output device to speaker when usb card is
not existed.

CRs-Fixed: 2264971
Change-Id: Ibfe43c4795a76bf386ab9008a632ef07aa1c7f28
1 file changed