From cc750d3604b33a92374253b12dd739dc06440aad Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 25 Jun 2015 11:48:20 -0700 Subject: audio policy: fix several device descriptor issues. - checkOutputsForDevice() should only clear device descriptor attributes if the device is digital. - checkInputsForDevice() did not clear device descriptor attributes at all. - AudioPort::clearCapabilities() and importAudioPort() should not manage gains as these are device specific. - importAudioPort() should load a default port config. Bug: 21990937. Change-Id: Ida762ed8f9baaabae392cb4291eff1a8d3009751 --- .../common/managerdefinitions/src/AudioPort.cpp | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp') diff --git a/services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp b/services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp index afcd073..4e24f19 100644 --- a/services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp +++ b/services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp @@ -151,28 +151,12 @@ void AudioPort::importAudioPort(const sp port) { } } } - for (size_t k = 0 ; k < port->mGains.size() ; k++) { - sp gain = port->mGains.itemAt(k); - if (gain != 0) { - bool hasGain = false; - for (size_t l = 0 ; l < mGains.size() ; l++) { - if (gain == mGains.itemAt(l)) { - hasGain = true; - break; - } - } - if (!hasGain) { // never import a gain twice - mGains.add(gain); - } - } - } } void AudioPort::clearCapabilities() { mChannelMasks.clear(); mFormats.clear(); mSamplingRates.clear(); - mGains.clear(); } void AudioPort::loadSamplingRates(char *name) -- cgit v1.1