Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5e7e79b authored by bryant_liu's avatar bryant_liu Committed by Dmitry Shmidt
Browse files

audiopolicy: Indicate output device change to all input threads for pre-processing

Bug: 17129715

Change-Id: I1fd938cce0b85241c80ea00f3d013a98948d3975
parent 890a5637
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -4317,6 +4317,20 @@ uint32_t AudioPolicyManager::setOutputDevice(audio_io_handle_t output,
                mpClientInterface->onAudioPatchListUpdate();
            }
        }

        // inform all input as well
        for (size_t i = 0; i < mInputs.size(); i++) {
            const sp<AudioInputDescriptor>  inputDescriptor = mInputs.valueAt(i);
            if (!isVirtualInputDevice(inputDescriptor->mDevice)) {
                AudioParameter inputCmd = AudioParameter();
                ALOGV("%s: inform input %d of device:%d", __func__,
                      inputDescriptor->mIoHandle, device);
                inputCmd.addInt(String8(AudioParameter::keyRouting),device);
                mpClientInterface->setParameters(inputDescriptor->mIoHandle,
                                                 inputCmd.toString(),
                                                 delayMs);
            }
        }
    }

    // update stream volumes according to new device