Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce0f2a8d authored by Mike Lockwood's avatar Mike Lockwood Committed by Android Git Automerger
Browse files

am 9500fd5c: am 954a5d61: Merge "AudioService: Send "becoming noisy" intent...

am 9500fd5c: am 954a5d61: Merge "AudioService: Send "becoming noisy" intent when USB accessory audio is disconnected" into jb-mr1-dev

* commit '9500fd5c':
  AudioService: Send "becoming noisy" intent when USB accessory audio is disconnected
parents fe3765cd 9500fd5c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -3490,14 +3490,17 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
                    (device == AudioSystem.DEVICE_OUT_WIRED_HEADPHONE))) {
                setBluetoothA2dpOnInt(true);
            }
            handleDeviceConnection((state == 1), device, "");
            boolean isUsb = ((device & AudioSystem.DEVICE_OUT_ALL_USB) != 0);
            handleDeviceConnection((state == 1), device, (isUsb ? name : ""));
            if ((state != 0) && ((device == AudioSystem.DEVICE_OUT_WIRED_HEADSET) ||
                    (device == AudioSystem.DEVICE_OUT_WIRED_HEADPHONE))) {
                setBluetoothA2dpOnInt(false);
            }
            if (!isUsb) {
                sendDeviceConnectionIntent(device, state, name);
            }
        }
    }

    /* cache of the address of the last dock the device was connected to */
    private String mDockAddress;
@@ -3587,7 +3590,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
                        + (action.equals(Intent.ACTION_USB_AUDIO_ACCESSORY_PLUG) ?
                              "ACTION_USB_AUDIO_ACCESSORY_PLUG" : "ACTION_USB_AUDIO_DEVICE_PLUG")
                        + ", state = " + state + ", card: " + alsaCard + ", device: " + alsaDevice);
                handleDeviceConnection((state == 1), device, params);
                setWiredDeviceConnectionState(device, state, params);
            } else if (action.equals(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED)) {
                boolean broadcast = false;
                int scoAudioState = AudioManager.SCO_AUDIO_STATE_ERROR;