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

Commit b4841f03 authored by Carter Hsu's avatar Carter Hsu Committed by Android (Google) Code Review
Browse files

Merge "audio: create audio patch when the highest input soruce change" into sc-dev

parents 52a8c1e6 e6139d5c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2531,12 +2531,14 @@ status_t AudioPolicyManager::stopInput(audio_port_handle_t portId)
        ALOGW("%s input %d client %d already stopped", __FUNCTION__, input, client->portId());
        return INVALID_OPERATION;
    }

    auto old_source = inputDesc->source();
    inputDesc->setClientActive(client, false);

    inputDesc->stop();
    if (inputDesc->isActive()) {
        setInputDevice(input, getNewInputDevice(inputDesc), false /* force */);
        auto current_source = inputDesc->source();
        setInputDevice(input, getNewInputDevice(inputDesc),
                old_source != current_source /* force */);
    } else {
        sp<AudioPolicyMix> policyMix = inputDesc->mPolicyMix.promote();
        // if input maps to a dynamic policy with an activity listener, notify of state change