diff options
author | Eric Laurent <elaurent@google.com> | 2014-10-27 16:07:59 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-10-28 09:14:37 -0700 |
commit | b80a2a8871d3af8619bf774a0c9ddbac8d598bf9 (patch) | |
tree | c3922d648914fd6f02d34f16712f76906f6ecdc9 /services/audiopolicy | |
parent | 701b96474dc8afd16046e440975e00be57cc4874 (diff) | |
download | frameworks_av-b80a2a8871d3af8619bf774a0c9ddbac8d598bf9.zip frameworks_av-b80a2a8871d3af8619bf774a0c9ddbac8d598bf9.tar.gz frameworks_av-b80a2a8871d3af8619bf774a0c9ddbac8d598bf9.tar.bz2 |
audio policy: fix output device command after clearing audio patch
Make sure that a valid audio patch is created again on an output stream
following the disconneciton and reconnection of the same output device.
Bug: 18144611.
Change-Id: I72387ad8e93f8fb2571da2a6c58a6e167ac7fc4d
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 535e825..01a6c55 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -4358,11 +4358,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; } |