AudioFlinger: fix set parameters on mmap streams am: e6e9a4811d am: 25bae7bb6f

am: fcb93982c8

Change-Id: I678361fe0dcf0697aec884f088bd1e1f9ccda16f
gugelfrei
Eric Laurent 7 years ago committed by android-build-merger
commit e14b039fab

@ -7877,17 +7877,34 @@ bool AudioFlinger::MmapThread::checkForNewParameter_l(const String8& keyValuePai
{
AudioParameter param = AudioParameter(keyValuePair);
int value;
bool sendToHal = true;
if (param.getInt(String8(AudioParameter::keyRouting), value) == NO_ERROR) {
audio_devices_t device = (audio_devices_t)value;
// forward device change to effects that have requested to be
// aware of attached audio device.
if (value != AUDIO_DEVICE_NONE) {
mOutDevice = value;
if (device != AUDIO_DEVICE_NONE) {
for (size_t i = 0; i < mEffectChains.size(); i++) {
mEffectChains[i]->setDevice_l(mOutDevice);
mEffectChains[i]->setDevice_l(device);
}
}
if (audio_is_output_devices(device)) {
mOutDevice = device;
if (!isOutput()) {
sendToHal = false;
}
} else {
mInDevice = device;
if (device != AUDIO_DEVICE_NONE) {
mPrevInDevice = value;
}
// TODO: implement and call checkBtNrec_l();
}
}
if (sendToHal) {
status = mHalStream->setParameters(keyValuePair);
} else {
status = NO_ERROR;
}
status = mHalStream->setParameters(keyValuePair);
return false;
}

Loading…
Cancel
Save