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

Commit b116f5e5 authored by Carter Hsu's avatar Carter Hsu Committed by Automerger Merge Worker
Browse files

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/15221128

Change-Id: I9b3917898e06c871db80b356023018aad0901aaa
parents efcd6c67 b4841f03
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