summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-09-26 18:50:09 -0700
committerEric Laurent <elaurent@google.com>2012-09-26 18:54:57 -0700
commit76e97d3950f2654adbb0a415218b6d048200c395 (patch)
treee22a17734a53262d66f4338418353d5362fad11d /audio
parentbe13d2ebd0ee66e8c09d978107c14a4221b04dff (diff)
downloadhardware_libhardware_legacy-76e97d3950f2654adbb0a415218b6d048200c395.zip
hardware_libhardware_legacy-76e97d3950f2654adbb0a415218b6d048200c395.tar.gz
hardware_libhardware_legacy-76e97d3950f2654adbb0a415218b6d048200c395.tar.bz2
audio policy: force device update if disconnected
Force the new device selection to be applied when a device is disconnected even if none is select. This is to indicate to the audio HAL that current device selection is not valid anymore even if no new device is selected because no audio track is active. Bug 7141149. Change-Id: Iade02fb53a4cc2051fce9da07870c5391396b696
Diffstat (limited to 'audio')
-rw-r--r--audio/AudioPolicyManagerBase.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp
index 4e0d60f..8e3fb0c 100644
--- a/audio/AudioPolicyManagerBase.cpp
+++ b/audio/AudioPolicyManagerBase.cpp
@@ -169,7 +169,10 @@ status_t AudioPolicyManagerBase::setDeviceConnectionState(audio_devices_t device
updateDevicesAndOutputs();
for (size_t i = 0; i < mOutputs.size(); i++) {
- setOutputDevice(mOutputs.keyAt(i), getNewDevice(mOutputs.keyAt(i), true /*fromCache*/));
+ setOutputDevice(mOutputs.keyAt(i),
+ getNewDevice(mOutputs.keyAt(i), true /*fromCache*/),
+ true,
+ 0);
}
if (device == AUDIO_DEVICE_OUT_WIRED_HEADSET) {