diff options
author | Mike Lockwood <lockwood@google.com> | 2012-09-18 17:12:37 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-18 17:12:37 -0700 |
commit | 954a5d61a2b66a64a841669f75e1cbd9103029b5 (patch) | |
tree | 5f38b593c197a6cac97b22dea79a339cf7589b1c /media/java | |
parent | 24755d2b4248c2aa678e08a4703e8e97fd2e7dd1 (diff) | |
parent | db45484e4b5858d14da93d3a06311b93bf0cf320 (diff) | |
download | frameworks_base-954a5d61a2b66a64a841669f75e1cbd9103029b5.zip frameworks_base-954a5d61a2b66a64a841669f75e1cbd9103029b5.tar.gz frameworks_base-954a5d61a2b66a64a841669f75e1cbd9103029b5.tar.bz2 |
Merge "AudioService: Send "becoming noisy" intent when USB accessory audio is disconnected" into jb-mr1-dev
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioService.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 4459d03..3a398a1 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -3490,12 +3490,15 @@ 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); } - sendDeviceConnectionIntent(device, state, name); + if (!isUsb) { + sendDeviceConnectionIntent(device, state, name); + } } } @@ -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; |