hal: use handset-mic as input device when USB headset is unplugged.

During VoIP call, when USB headset is unplugged, AUDIO_DEVICE_OUT_USB_DEVICE
is first disconnected. This causes compress-voip stops, and other active
playback usecases output devices route to handset. But input device still
routes to AUDIO_DEVICE_IN_USB_HEADSET. When device restore happens, input
device selects AUDIO_DEVICE_IN_USB_HEADSET even if USB headset is not existed.
This causes mute issue happens.

Fix it by checking USB headset device state to select handset as input device
when USB headset is unplugged.

CRs-Fixed: 2264971
Change-Id: I69b2f0f030309a28256cf69330f85069994f3ea0
2 files changed