OSDN Git Service

Built-in mic is not used when USB mic is disconnected
authorAlejandro Ochoa <alejandro.ochoa@intel.com>
Sat, 31 Oct 2015 02:05:00 +0000 (20:05 -0600)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 20 Jul 2016 09:53:18 +0000 (17:53 +0800)
In some cases when the USB microphone is disconnected,
audio stack does not switch to the built-in microphone.
It gets stuck in a state where it still recognizes the
USB mic is still connected. Current device removal
implementation only considers USB output devices such
as headset. The same process should be used for input
USB devices (microphone).

Bug: 24932354
Change-Id: Ic2089ef5a9a318cb47336ade405f79eccd7129f8
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-6651
Signed-off-by: Alejandro Ochoa <alejandro.ochoa@intel.com>
Reviewed-on: https://android.intel.com:443/432909

services/usb/java/com/android/server/usb/UsbAlsaManager.java

index 31763e7..701272e 100644 (file)
@@ -439,7 +439,7 @@ public final class UsbAlsaManager {
 
         UsbAudioDevice audioDevice = mAudioDevices.remove(usbDevice);
         if (audioDevice != null) {
-            if (audioDevice.mHasPlayback || audioDevice.mHasPlayback) {
+            if (audioDevice.mHasPlayback || audioDevice.mHasCapture) {
                 notifyDeviceState(audioDevice, false);
 
                 // if there any external devices left, select one of them