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)
committerGlenn Kasten <gkasten@android.com>
Wed, 4 Nov 2015 15:58:09 +0000 (15:58 +0000)
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
Signed-off-by: Alejandro Ochoa <alejandro.ochoa@intel.com>
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