summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-01-20 22:40:44 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-20 22:40:45 +0000
commit1ed13b3b443735e7f7b5002954f31741b0b1c572 (patch)
tree8b39b51fe1088524df858f88250355b90b431b32
parent1efe46deb86b8ca246e2486ec16d88efd9e1e657 (diff)
parent832141ca6138fa0d0bb0a9d62b033781db49ff5d (diff)
downloadframeworks_av-1ed13b3b443735e7f7b5002954f31741b0b1c572.zip
frameworks_av-1ed13b3b443735e7f7b5002954f31741b0b1c572.tar.gz
frameworks_av-1ed13b3b443735e7f7b5002954f31741b0b1c572.tar.bz2
Merge "DO NOT MERGE - audio policy: fix output device command after clearing audio patch"
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index 3e1506d..db320af 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -4345,11 +4345,15 @@ uint32_t AudioPolicyManager::setOutputDevice(audio_io_handle_t output,
muteWaitMs = checkDeviceMuteStrategies(outputDesc, prevDevice, delayMs);
// Do not change the routing if:
- // - the requested device is AUDIO_DEVICE_NONE
- // - the requested device is the same as current device and force is not specified.
+ // the requested device is AUDIO_DEVICE_NONE
+ // OR the requested device is the same as current device
+ // AND force is not specified
+ // AND the output is connected by a valid audio patch.
// Doing this check here allows the caller to call setOutputDevice() without conditions
- if ((device == AUDIO_DEVICE_NONE || device == prevDevice) && !force) {
- ALOGV("setOutputDevice() setting same device %04x or null device for output %d", device, output);
+ if ((device == AUDIO_DEVICE_NONE || device == prevDevice) && !force &&
+ outputDesc->mPatchHandle != 0) {
+ ALOGV("setOutputDevice() setting same device %04x or null device for output %d",
+ device, output);
return muteWaitMs;
}